...
 
Commits (76)
......@@ -26,7 +26,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "AddCopyIntrinsic.hpp"
#include "Compiler/MetaDataApi/IGCMetaDataHelper.h"
#include "Compiler/MetaDataApi/IGCMetaDataDefs.h"
#include "Compiler/MetaDataUtilsWrapper.h"
#include "Compiler/IGCPassSupport.h"
#include "Compiler/CodeGenPublic.h"
......
This diff is collapsed.
......@@ -322,7 +322,7 @@ namespace IGC
private:
/// @brief All possible implicit arguments
static const ImplicitArg IMPLICIT_ARGS[ImplicitArg::NUM_IMPLICIT_ARGS];
std::vector<ImplicitArg> IMPLICIT_ARGS;
/// @brief Maps operand numbers in the implicit argument metadata
/// nodes to implicit argument types.
......
......@@ -26,7 +26,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "ProcessFuncAttributes.h"
#include "Compiler/MetaDataApi/IGCMetaDataHelper.h"
#include "Compiler/MetaDataApi/IGCMetaDataDefs.h"
#include "Compiler/MetaDataUtilsWrapper.h"
#include "Compiler/IGCPassSupport.h"
#include "Compiler/CodeGenPublic.h"
......@@ -162,24 +161,31 @@ static bool containsOpaque(llvm::Type *T)
return false;
}
static bool hasSLMUsage(llvm::Module &M)
// __builtin_spirv related OpGroup call implementations contain both
// workgroup and subgroup code in them that is switched on based on the
// 'Execution' and 'Operation' parameters and these will almost always
// be compile time literals. Let's inline these functions so we have a chance
// at optimizing away the branches that contain workgroup code that will cause
// SLM allocations when we're really doing a subgroup calls.
static DenseSet<Function*> collectMemPoolUsage(const Module &M)
{
for (auto &G : M.getGlobalList())
const char *BUILTIN_MEMPOOL = "__builtin_IB_AllocLocalMemPool";
auto *MemPool = M.getFunction(BUILTIN_MEMPOOL);
DenseSet<Function*> FuncsToInline;
if (!MemPool)
return FuncsToInline;
for (auto *U : MemPool->users())
{
if (!G.use_empty() &&
G.getType()->getAddressSpace() == ADDRESS_SPACE_LOCAL)
if (auto *CI = dyn_cast<CallInst>(U))
{
return true;
FuncsToInline.insert(CI->getFunction());
}
}
const char *BUILTIN_MEMPOOL = "__builtin_IB_AllocLocalMemPool";
if (auto F = M.getFunction(BUILTIN_MEMPOOL))
{
return !F->use_empty();
}
return false;
return FuncsToInline;
}
bool ProcessFuncAttributes::runOnModule(Module& M)
......@@ -187,7 +193,7 @@ bool ProcessFuncAttributes::runOnModule(Module& M)
MetaDataUtilsWrapper &mduw = getAnalysis<MetaDataUtilsWrapper>();
MetaDataUtils *pMdUtils = mduw.getMetaDataUtils();
ModuleMetaData *modMD = mduw.getModuleMetaData();
bool containsSLM = false; // hasSLMUsage(M);
auto MemPoolFuncs = collectMemPoolUsage(M);
std::set<llvm::Function *> fastMathFunct;
GlobalVariable *gv_fastMath = M.getGlobalVariable("__FastRelaxedMath", true);
......@@ -274,7 +280,7 @@ bool ProcessFuncAttributes::runOnModule(Module& M)
// The following subroutine check is added to disable two-phase-inlining
// when we do not enable subroutines.
bool keepAlwaysInline = containsSLM;
bool keepAlwaysInline = (MemPoolFuncs.count(F) != 0);
if (IGC_GET_FLAG_VALUE(FunctionControl) != FLAG_FCALL_FORCE_INLINE)
{
// keep inline if function pointers not enabled and there are uses
......@@ -474,11 +480,10 @@ bool ProcessBuiltinMetaData::runOnModule(Module& M)
void ProcessBuiltinMetaData::updateBuiltinFunctionMetaData(llvm::Function* pFunc)
{
IGCMD::FunctionInfoMetaDataHandle fHandle = IGCMD::FunctionInfoMetaDataHandle(IGCMD::FunctionInfoMetaData::get());
IGC::ModuleMetaData* modMD = getAnalysis<CodeGenContextWrapper>().getCodeGenContext()->getModuleMetaData();
FunctionMetaData *funcMD = &modMD->FuncMD[pFunc]; //okay to insert if not present
fHandle->setType(IGC::IGCMD::FunctionTypeEnum::OtherFunctionType);
funcMD->functionType = IGC::FunctionTypeMD::UserFunction;
fHandle->setType(FunctionTypeMD::UserFunction);
for (auto arg = pFunc->arg_begin(); arg != pFunc->arg_end(); ++arg)
{
std::string typeStr;
......
......@@ -29,8 +29,12 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "../../../Compiler/CodeGenPublic.h"
#include "program_debug_data.h"
#include "../../../common/Types.hpp"
#include "../../../common/shaderOverride.hpp"
#include "../../../Compiler/CISACodeGen/OpenCLKernelCodeGen.hpp"
#include <iomanip>
#include <fstream>
namespace iOpenCL
{
......@@ -138,6 +142,75 @@ RETVAL CGen8OpenCLProgram::GetProgramDebugData(Util::BinaryStream& programDebugD
return retValue;
}
void dumpOCLKernelBinary(
const IGC::COpenCLKernel *Kernel,
const KernelData &data)
{
#if LLVM_VERSION_MAJOR >= 7
using namespace IGC;
using namespace IGC::Debug;
auto *Ctx = Kernel->GetContext();
auto &kernelName = Kernel->m_kernelInfo.m_kernelName;
auto name = DumpName(IGC::Debug::GetShaderOutputName())
.Hash(Ctx->hash)
.Type(ShaderType::OPENCL_SHADER)
.PostFix(kernelName)
.Extension("kernbin");
auto *KernBin = data.kernelBinary;
std::error_code EC;
llvm::raw_fd_ostream f(name.str(), EC);
if (!EC)
f.write(KernBin->GetLinearPointer(), (size_t)KernBin->Size());
#endif
}
void overrideOCLKernelBinary(
const IGC::COpenCLKernel *Kernel,
KernelData &data)
{
using namespace IGC;
using namespace IGC::Debug;
auto *Ctx = Kernel->GetContext();
auto &kernelName = Kernel->m_kernelInfo.m_kernelName;
auto name = DumpName(IGC::Debug::GetShaderOutputName())
.Hash(Ctx->hash)
.Type(ShaderType::OPENCL_SHADER)
.PostFix(kernelName)
.Extension("kernbin");
std::string Path = name.overridePath();
std::ifstream f(Path, std::ios::binary);
if (!f.is_open())
return;
appendToShaderOverrideLogFile(Path, "OVERRIDDEN: ");
f.seekg(0, f.end);
int newBinarySize = (int)f.tellg();
f.seekg(0, f.beg);
auto *&KernBin = data.kernelBinary;
delete KernBin;
KernBin = new Util::BinaryStream();
std::unique_ptr<char[]> Buf(new char[newBinarySize]);
f.read(Buf.get(), newBinarySize);
assert(f && "Not fully read!");
KernBin->Write(Buf.get(), newBinarySize);
}
void CGen8OpenCLProgram::CreateKernelBinaries()
{
auto isValidShader = [&](IGC::COpenCLKernel* shader)->bool
......@@ -191,6 +264,12 @@ void CGen8OpenCLProgram::CreateKernelBinaries()
m_pSystemThreadKernelOutput,
pOutput->m_unpaddedProgramSize);
if (IGC_IS_FLAG_ENABLED(ShaderDumpEnable))
dumpOCLKernelBinary(kernel, data);
if (IGC_IS_FLAG_ENABLED(ShaderOverride))
overrideOCLKernelBinary(kernel, data);
assert(data.kernelBinary && data.kernelBinary->Size() > 0);
// Create the debug data binary streams
......
......@@ -105,7 +105,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "Compiler/SPIRMetaDataTranslation.h"
#include "Compiler/Optimizer/OpenCLPasses/ErrorCheckPass.h"
#include "AdaptorCommon/AddCopyIntrinsic.hpp"
#include "Compiler/MetaDataApi/IGCMetaDataDefs.h"
#include "Compiler/MetaDataApi/IGCMetaDataHelper.h"
#include "Compiler/CodeGenContextWrapper.hpp"
#include "Compiler/FixResourcePtr.hpp"
......
......@@ -31,7 +31,7 @@ ENDIF()
SET(ThirdPartyDir "third_party")
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD 14)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
IF(NOT MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth=1024")
......
This diff is collapsed.
......@@ -5,6 +5,6 @@ libdir=${exec_prefix}/lib
Name: igc-opencl
Description: Intel(R) Graphics Compiler for OpenCL(TM)
Version: @MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@
Version: @IGC_API_MAJOR_VERSION@.@IGC_API_MINOR_VERSION@.@IGC_API_PATCH_VERSION@
Cflags: -I${includedir} -I${includedir}/cif -I${includedir}/ocl_igc_shared/executable_format -I${includedir}/ocl_igc_shared/device_enqueue
Libs:
......@@ -24,9 +24,41 @@ typedef enum _cmc_error_t {
CMC_ERROR_IN_COMPILING_IR = 5
} cmc_error_t;
typedef struct _cmc_kernel_info {
/// The kernel name.
const char *name;
/// The number of kernel arguments with descriptors.
unsigned num_arg_desc;
/// The kernel argument descriptors.
const char **arg_desc;
} cmc_kernel_info;
typedef struct _cmc_jit_info {
/// The vISA binary size in bytes.
size_t binary_size;
/// The vISA binary data.
void *binary;
/// The vISA major version.
unsigned visa_major_version;
/// The vISA minor version.
unsigned visa_minor_version;
/// The number of kernels in this binary.
unsigned num_kernels;
/// The kernel infomation for each kernel.
cmc_kernel_info *kernel_info;
/// The context for this compilation. This opaque data holds all memory
/// allocations that will be freed in the end.
void *context;
} cmc_jit_info;
__EXPORT__ cmc_error_t cmc_load_and_compile(const char *input,
......
......@@ -33,21 +33,12 @@
# In new Clang versions VME types are built-in. Keep this flag until all OS's update Clang version to 8
if(NOT DEFINED VME_TYPES_DEFINED)
set(VME_TYPES_DEFINED FALSE)
if(CMAKE_SYSTEM_NAME STREQUAL Linux)
set(VME_TYPES_DEFINED TRUE)
endif()
endif()
set(CLANG_EXE_VERSION_GE_7 FALSE)
if(CMAKE_SYSTEM_NAME STREQUAL Linux)
set(CLANG_EXE_VERSION_GE_7 TRUE)
set(VME_TYPES_DEFINED TRUE)
endif()
set(CCLANG_BUILD_INTREE_LLVM FALSE)
if(EXISTS ${LLVM_SOURCE_DIR}/projects/opencl-clang)
set(CCLANG_BUILD_INTREE_LLVM TRUE)
set(VME_TYPES_DEFINED TRUE)
set(CLANG_SOURCE_DIR ${LLVM_SOURCE_DIR}/tools/clang)
endif()
......@@ -131,22 +122,6 @@ endif()
get_property(_clang7zLocation TARGET CLANG_7Z PROPERTY IMPORTED_LOCATION_RELEASE)
if(NOT DEFINED COMMON_CLANG_LIBRARY_NAME AND
EXISTS ${_clang7zLocation}
)
if(WIN32)
set(COMMON_CLANG_LIBRARY_NAME common_clang${_cpuSuffix})
else()
set(COMMON_CLANG_LIBRARY_NAME common_clang)
endif()
endif()
if(WIN32)
set(COMMON_CLANG_LIB_FULL_NAME "${COMMON_CLANG_LIBRARY_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}")
else()
set(COMMON_CLANG_LIB_FULL_NAME "lib${COMMON_CLANG_LIBRARY_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif()
if(NOT ${CCLANG_BUILD_INTREE_LLVM})
# Add step to preform the extraction
add_custom_command(
......@@ -169,11 +144,12 @@ endif()
set(CL_OPTIONS "")
add_custom_target(GetClang)
add_library(common_clang_dll UNKNOWN IMPORTED GLOBAL)
add_library(common_clang_dll SHARED IMPORTED GLOBAL)
if(EXISTS ${_clang7zLocation} AND NOT ${CCLANG_BUILD_INTREE_LLVM})
# Use precompiled common clang bundle.
message(STATUS "Use precompiled common clang from ${_clang7zLocation}")
set(SYSTEM_COMMON_CLANG OFF)
add_dependencies(GetClang UnzipClang)
......@@ -186,38 +162,15 @@ endif()
set(IGC_CCLANG_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/clang_build)
if(${CCLANG_BUILD_INTREE_LLVM})
message("Common clang build-in-tree")
set(CCLANG_INSTALL_ARTIFACTS_DIR ${IGC_TARGET__TOOLS_CLANG_DIR})
if(NOT CCLANG_OCL_HEADERS_DIR)
if (EXISTS "${IGC_BUILD__GFX_DEV_SRC_DIR}/third_party/opencl_headers")
set(CCLANG_OCL_HEADERS_DIR "${IGC_BUILD__GFX_DEV_SRC_DIR}/third_party/opencl_headers")
else()
get_filename_component(CCLANG_OCL_HEADERS_DIR "${IGC_BUILD__GFX_DEV_SRC_DIR}/../opencl_headers" ABSOLUTE)
endif()
endif(NOT CCLANG_OCL_HEADERS_DIR)
set(clang_filename "clang${CMAKE_EXECUTABLE_SUFFIX}")
add_custom_command(
OUTPUT "${IGC_TARGET__TOOLS_CLANG_DIR}/${clang_filename}"
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:clang>" "${IGC_TARGET__TOOLS_CLANG_DIR}/${clang_filename}"
DEPENDS clang
)
add_custom_command(
OUTPUT "${IGC_TARGET__TOOLS_CLANG_DIR}/${COMMON_CLANG_LIB_FULL_NAME}"
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:${COMMON_CLANG_LIBRARY_NAME}>" "${IGC_TARGET__TOOLS_CLANG_DIR}/${COMMON_CLANG_LIB_FULL_NAME}"
DEPENDS ${COMMON_CLANG_LIBRARY_NAME}
)
set(cclang_header_filename "opencl-c.h")
add_custom_command(
OUTPUT "${IGC_TARGET__TOOLS_CLANG_DIR}/${cclang_header_filename}"
COMMAND ${CMAKE_COMMAND} -E copy "${CLANG_SOURCE_DIR}/lib/Headers/${cclang_header_filename}" "${IGC_TARGET__TOOLS_CLANG_DIR}/${cclang_header_filename}"
DEPENDS cl_headers
)
set(SYSTEM_COMMON_CLANG OFF)
add_custom_target(copy_cclang_files ALL
DEPENDS ${IGC_TARGET__TOOLS_CLANG_DIR}/${clang_filename} ${IGC_TARGET__TOOLS_CLANG_DIR}/${COMMON_CLANG_LIB_FULL_NAME} ${IGC_TARGET__TOOLS_CLANG_DIR}/${cclang_header_filename}
COMMAND ${CMAKE_COMMAND} -E make_directory "${IGC_TARGET__TOOLS_CLANG_DIR}"
COMMAND ${CMAKE_COMMAND} -E copy "${CLANG_SOURCE_DIR}/lib/Headers/opencl-c.h" "${IGC_TARGET__TOOLS_CLANG_DIR}/"
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:clang>" "${IGC_TARGET__TOOLS_CLANG_DIR}/clang${CMAKE_EXECUTABLE_SUFFIX}"
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_LINKER_FILE:${COMMON_CLANG_LIBRARY_NAME}>" "${IGC_TARGET__TOOLS_CLANG_DIR}/"
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_SONAME_FILE:${COMMON_CLANG_LIBRARY_NAME}>" "${IGC_TARGET__TOOLS_CLANG_DIR}/"
DEPENDS clang cl_headers ${COMMON_CLANG_LIBRARY_NAME}
)
add_dependencies(GetClang copy_cclang_files)
......@@ -252,9 +205,9 @@ endif()
endif()
add_dependencies(common_clang_dll GetClang)
if(UNIX)
install(FILES $<TARGET_FILE:common_clang_dll> DESTINATION ${IGC_INSTALL_TIME_ROOT_DIR}/lib COMPONENT igc-opencl)
endif(UNIX)
if(UNIX AND NOT SYSTEM_COMMON_CLANG)
install(FILES $<TARGET_SONAME_FILE:common_clang_dll> DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT igc-opencl)
endif()
# End Clang section
......@@ -971,9 +924,6 @@ set(FLAG "")
if(${VME_TYPES_DEFINED})
list(APPEND FLAG "__VME_TYPES_DEFINED__")
endif(${VME_TYPES_DEFINED})
if(${CLANG_EXE_VERSION_GE_7})
list(APPEND FLAG "__CLANG7__")
endif()
igc_bif_find_cl_files(IGC_BUILD__BIF_OCL_COMMON_DEPENDS ${IGC_BUILD__BIF_OCL_COMMON_INC_DIRS} "${IGC_OPTION__BIF_SRC_OCL_DIR}/Implementation")
......
......@@ -401,13 +401,6 @@ ndrange_t __attribute__((overloadable)) ndrange_3D(const size_t[3]);
ndrange_t __attribute__((overloadable)) ndrange_3D(const size_t[3], const size_t[3]);
ndrange_t __attribute__((overloadable)) ndrange_3D(const size_t[3], const size_t[3], const size_t[3]);
#ifndef __CLANG7__ // Clang 7.0+
#if defined(cl_khr_subgroups)
uint __attribute__((overloadable)) get_kernel_sub_group_count_for_ndrange(const ndrange_t range, void(^block)(void));
uint __attribute__((overloadable)) get_kernel_max_sub_group_size_for_ndrange(const ndrange_t range, void(^block)(void));
#endif
#endif // !__VME_TYPES_DEFINED__
void __attribute__((overloadable)) retain_event(clk_event_t);
void __attribute__((overloadable)) release_event(clk_event_t);
......
This diff is collapsed.
......@@ -121,7 +121,7 @@ bool BlockCoalescing::runOnFunction(Function& F)
{
break;
}
if(deSSA->isPHIIsolated(phi))
if(deSSA->isIsolated(phi))
{
m_emptyBlocks.erase(bb);
for(pred_iterator PI = pred_begin(bb), PE = pred_end(bb); PI != PE; PI++)
......
......@@ -27,7 +27,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "Compiler/CISACodeGen/ShaderCodeGen.hpp"
#include "Compiler/CISACodeGen/PixelShaderCodeGen.hpp"
#include "Compiler/CISACodeGen/ComputeShaderCodeGen.hpp"
#include "Compiler/MetaDataApi/IGCMetaDataDefs.h"
#include "common/allocator.h"
#include "common/Types.hpp"
#include "common/Stats.hpp"
......@@ -39,7 +38,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "common/shaderOverride.hpp"
#include "common/CompilerStatsUtils.hpp"
#include "inc/common/sku_wa.h"
#include "inc/common/RelocationInfo.h"
#include <iStdLib/utility.h>
#if !defined(_WIN32)
......@@ -608,11 +606,12 @@ void CEncoder::SetDstModifier(const DstModifier& modifier)
}
}
void CEncoder::SetSrcRegion(uint srcNum, uint vStride, uint width, uint hStride)
void CEncoder::SetSrcRegion(uint srcNum, uint vStride, uint width, uint hStride, e_instance instance)
{
m_encoderState.m_srcOperand[srcNum].region[0] = int_cast<uint8_t>(vStride);
m_encoderState.m_srcOperand[srcNum].region[1] = int_cast<uint8_t>(width);
m_encoderState.m_srcOperand[srcNum].region[2] = int_cast<uint8_t>(hStride);
m_encoderState.m_srcOperand[srcNum].instance = instance;
m_encoderState.m_srcOperand[srcNum].specialRegion = true;
}
......@@ -730,7 +729,7 @@ VISA_VectorOpnd* CEncoder::GetSourceOperand(CVariable* var, const SModifier& mod
GetRowAndColOffset(var, mod.subVar, mod.subReg, rowOffset, colOffset);
V(vKernel->CreateVISASrcOperand(
operand,
GetVISAVariable(var),
GetVISAVariable(var, mod.instance),
ConvertModifierToVisaType(mod.mod),
vStride,
width,
......@@ -1016,6 +1015,7 @@ bool CEncoder::NeedSplitting(CVariable *var, const SModifier &mod,
}
assert(false && "Unhandled special source region on QWORD type!");
}
numParts = std::max(numParts, 2U);
return true;
}
......@@ -1671,7 +1671,7 @@ void CEncoder::AddPair(CVariable *Lo, CVariable *Hi, CVariable *L0, CVariable *H
if (H1->GetType() != ISA_TYPE_UD && H1->GetType() != ISA_TYPE_UV) H1 = m_program->BitCast(H1, ISA_TYPE_UD);
Common_ISA_Exec_Size ExecSize = GetAluExecSize(Lo);
assert(ExecSize == EXEC_SIZE_16 || ExecSize == EXEC_SIZE_8 ||
assert(ExecSize == EXEC_SIZE_32 || ExecSize == EXEC_SIZE_16 || ExecSize == EXEC_SIZE_8 ||
ExecSize == EXEC_SIZE_4 || ExecSize == EXEC_SIZE_2 ||
ExecSize == EXEC_SIZE_1);
......@@ -1758,7 +1758,7 @@ void CEncoder::SubPair(CVariable *Lo, CVariable *Hi, CVariable *L0, CVariable *H
assert(m_encoderState.m_dstOperand.mod == EMOD_NONE && "subPair doesn't support saturate");
Common_ISA_Exec_Size ExecSize = GetAluExecSize(Lo);
assert(ExecSize == EXEC_SIZE_16 || ExecSize == EXEC_SIZE_8 || ExecSize == EXEC_SIZE_1);
assert(ExecSize == EXEC_SIZE_32 || ExecSize == EXEC_SIZE_16 || ExecSize == EXEC_SIZE_8 || ExecSize == EXEC_SIZE_1);
if (Hi == nullptr) {
// When Hi part is ignored, reduce 64-bit subtraction into 32-bit.
......@@ -2949,54 +2949,6 @@ void CEncoder::ScatterGather(ISA_Opcode opcode, CVariable* srcdst, CVariable* bu
dstVar));
}
void CEncoder::ScatterGather4(ISA_Opcode opcode, CVariable* srcdst, CVariable* bufId, CVariable* offset, CVariable* gOffset, e_predefSurface surface)
{
VISA_VectorOpnd* globalOffsetOpnd = nullptr;
if(gOffset)
{
globalOffsetOpnd = GetUniformSource(gOffset);
}
else
{
int value = 0;
V(vKernel->CreateVISAImmediate(globalOffsetOpnd, &value ,ISA_TYPE_UD));
}
VISA_RawOpnd* elementOffset = GetRawSource(offset);
VISA_StateOpndHandle* surfOpnd = GetVISASurfaceOpnd(surface, bufId);
VISA_RawOpnd* dstVar;
Common_VISA_EMask_Ctrl visaMask;
if(opcode == ISA_GATHER4)
{
dstVar = GetRawDestination(srcdst);
visaMask = GetAluEMask(srcdst);
}
else
{
dstVar = GetRawSource(srcdst);
visaMask = ConvertMaskToVisaType(m_encoderState.m_mask, m_encoderState.m_noMask);
}
uint nd = srcdst->GetSize();
if (m_encoderState.m_simdSize == SIMDMode::SIMD8)
nd = nd / SIZE_GRF;
else if (m_encoderState.m_simdSize == SIMDMode::SIMD16)
nd = nd / (SIZE_GRF * 2);
else
assert(0);
uint mask = BIT(nd)-1;
V(vKernel->AppendVISASurfAccessGather4Scatter4Inst(
opcode,
ConvertChannelMaskToVisaType(mask),
visaMask,
getExecSize(m_encoderState.m_simdSize),
surfOpnd,
globalOffsetOpnd,
elementOffset,
dstVar));
}
void CEncoder::GenericAlu(e_opcode opcode, CVariable* dst, CVariable* src0, CVariable* src1, CVariable* src2)
{
ISA_Opcode visaOpcode = ConvertOpcode[opcode];
......@@ -3770,6 +3722,10 @@ void CEncoder::InitEncoder( bool canAbortOnSpill, bool hasStackCall )
{
vbuilder->SetOption(vISA_ReservedGRFNum, IGC_GET_FLAG_VALUE(ReservedRegisterNum));
}
if (IGC_GET_FLAG_VALUE(GRFNumToUse) > 0)
{
vbuilder->SetOption(vISA_GRFNumToUse, IGC_GET_FLAG_VALUE(GRFNumToUse));
}
vbuilder->SetOption(vISA_TotalGRFNum, context->getNumGRFPerThread());
......@@ -4070,6 +4026,25 @@ VISA_GenVar* CEncoder::GetVISAVariable(CVariable* var)
return var->visaGenVariable[0];
}
VISA_GenVar* CEncoder::GetVISAVariable(CVariable* var, e_instance instance)
{
VISA_GenVar* result = GetVISAVariable(var);
if (instance != EINSTANCE_UNSPECIFIED &&
var->GetNumberInstance() == 2)
{
if (instance == EINSTANCE_FIRST_HALF)
{
result = var->visaGenVariable[0];
}
else
{
result = var->visaGenVariable[1];
}
}
return result;
}
void CEncoder::GetVISAPredefinedVar(CVariable* pVar, PreDefined_Vars var)
{
vKernel->GetPredefinedVar(pVar->visaGenVariable[0], var);
......@@ -4240,20 +4215,20 @@ void CEncoder::CreateFunctionSymbolTable(void*& buffer, unsigned& bufferSize, un
// Allocate buffer to store symbol table entries
tableEntries = funcsToExport.size();
bufferSize = sizeof(IGC::GenSymEntry) * tableEntries;
bufferSize = sizeof(vISA::GenSymEntry) * tableEntries;
buffer = (void*) malloc(bufferSize);
assert(buffer && "Function Symbol Table not allocated");
IGC::GenSymEntry* entry_ptr = (IGC::GenSymEntry*) buffer;
vISA::GenSymEntry* entry_ptr = (vISA::GenSymEntry*) buffer;
for (auto pFunc : funcsToExport)
{
assert(pFunc->getName().size() <= IGC::MAX_SYMBOL_NAME_LENGTH);
strcpy(entry_ptr->s_name, pFunc->getName().str().c_str());
assert(pFunc->getName().size() <= vISA::MAX_SYMBOL_NAME_LENGTH);
strcpy_s(entry_ptr->s_name, vISA::MAX_SYMBOL_NAME_LENGTH, pFunc->getName().str().c_str());
if (pFunc->isDeclaration())
{
// If the function is only declared, set as undefined type
entry_ptr->s_type = IGC::GenSymType::S_UNDEF;
entry_ptr->s_type = vISA::GenSymType::S_UNDEF;
entry_ptr->s_offset = 0;
}
else
......@@ -4263,7 +4238,7 @@ void CEncoder::CreateFunctionSymbolTable(void*& buffer, unsigned& bufferSize, un
// Query vISA for the function's byte offset within the compiled module
VISAFunction* visaFunc = Iter->second;
entry_ptr->s_type = IGC::GenSymType::S_FUNC;
entry_ptr->s_type = vISA::GenSymType::S_FUNC;
entry_ptr->s_offset = (uint32_t) visaFunc->getGenOffset();
}
entry_ptr++;
......@@ -4280,7 +4255,7 @@ void CEncoder::CreateFunctionRelocationTable(void*& buffer, unsigned& bufferSize
{
// vISA will directly return the buffer with GenRelocEntry layout
V(vMainKernel->GetGenRelocEntryBuffer(buffer, bufferSize, tableEntries));
assert(sizeof(IGC::GenRelocEntry) * tableEntries == bufferSize);
assert(sizeof(vISA::GenRelocEntry) * tableEntries == bufferSize);
}
}
......@@ -4566,7 +4541,11 @@ void CEncoder::Copy(CVariable* dst, CVariable* src)
void CEncoder::BoolToInt(CVariable* dst, CVariable* src)
{
assert(src->GetType() == ISA_TYPE_BOOL);
assert((dst->GetType() == ISA_TYPE_UD) || (dst->GetType() == ISA_TYPE_D));
VISA_Type dstType = dst->GetType();
assert((dstType == ISA_TYPE_UD) || (dstType == ISA_TYPE_D) ||
(dstType == ISA_TYPE_UB) ||(dstType == ISA_TYPE_B) ||
(dstType == ISA_TYPE_UW) || (dstType == ISA_TYPE_W));
// undef value are not copied
if(!src->IsUndef() || IGC_IS_FLAG_ENABLED(InitializeUndefValueEnable)) {
......
......@@ -55,12 +55,14 @@ struct SModifier
uint8_t subVar;
uint8_t region[3];
e_modifier mod;
e_instance instance;
bool specialRegion;
void init()
{
mod = EMOD_NONE;
subVar = 0;
subReg = 0;
instance = EINSTANCE_UNSPECIFIED;
specialRegion = false;
}
};
......@@ -92,7 +94,7 @@ class URBChannelMask
public:
explicit URBChannelMask(unsigned int bitmask) : m_bitmask(bitmask) {}
/// Returns the size of bitmask,
/// Returns the size of bitmask,
/// defined as the position of the most significant bit with value 1.
/// E.g. size(10001) == 5, size(1) == 1 , size(1111) = 4
size_t size() const;
......@@ -132,7 +134,7 @@ public:
SEncoderState CopyEncoderState();
void SetEncoderState(SEncoderState &newState);
void SetKernelStackPointer64();
void SetKernelStackPointer64();
void SetStackFunctionArgSize(uint size); // size in GRFs
void SetStackFunctionRetSize(uint size); // size in GRFs
......@@ -161,9 +163,9 @@ public:
void Send(CVariable* dst, CVariable* src, uint exDesc, CVariable* messDescriptor, bool isSendc = false);
void Send(CVariable* dst, CVariable* src, uint ffid, CVariable* exDesc, CVariable* messDescriptor, bool isSendc = false);
void Sends(CVariable* dst, CVariable* src0, CVariable* src1, uint ffid, CVariable* exDesc, CVariable* messDescriptor, bool isSendc = false);
void RenderTargetWrite(CVariable* var[],
void RenderTargetWrite(CVariable* var[],
bool isUndefined[],
bool lastRenderTarget,
bool lastRenderTarget,
bool perSample,
bool coarseMode,
bool headerMaskFromCe0,
......@@ -186,10 +188,10 @@ public:
void AddrAdd(CVariable* dst, CVariable* src0, CVariable* src1);
void Barrier(e_barrierKind BarrierKind);
void Fence(bool CommitEnable,
bool L3_Flush_RW_Data,
bool L3_Flush_Constant_Data,
bool L3_Flush_Texture_Data,
void Fence(bool CommitEnable,
bool L3_Flush_RW_Data,
bool L3_Flush_Constant_Data,
bool L3_Flush_Texture_Data,
bool L3_Flush_Instructions,
bool Global_Mem_Fence,
bool L1_Flush,
......@@ -268,11 +270,9 @@ public:
inline void LoadMS(EOPCODE subOpcode, uint writeMask, CVariable* offset, const ResourceDescriptor& resource, uint numSources, CVariable* dst, llvm::SmallVector<CVariable*, 4>& payload, bool feedbackEnable);
inline void SetP(CVariable* dst, CVariable* src);
inline void Gather(CVariable* dst, CVariable* bufidx, CVariable* offset, CVariable* gOffset, e_predefSurface surface, int elementSize);
inline void Gather4(CVariable* dst, CVariable* bufidx, CVariable* offset, e_predefSurface surface);
inline void TypedRead4(const ResourceDescriptor& resource, CVariable* pU, CVariable* pV, CVariable* pR, CVariable* pLOD, CVariable* pDst, uint writeMask);
inline void TypedWrite4(const ResourceDescriptor& resource, CVariable* pU, CVariable* pV, CVariable* pR, CVariable* pLOD, CVariable* pSrc);
inline void Scatter(CVariable* val, CVariable* bufidx, CVariable* offset, CVariable* gOffset, e_predefSurface surface, int elementSize);
inline void Scatter4(CVariable* val, CVariable* bufIdx, CVariable* offset, CVariable* gOffset, e_predefSurface surface);
inline void IShr( CVariable* dst, CVariable* src0, CVariable* src1 );
inline void Min(CVariable* dst, CVariable* src0, CVariable* src1);
inline void Max(CVariable* dst, CVariable* src0, CVariable* src1);
......@@ -330,7 +330,7 @@ public:
void SetPredicate(CVariable* flag);
void SetInversePredicate(bool inv);
void SetPredicateMode(e_predMode mode);
void SetSrcRegion(uint srcNum, uint vStride, uint width, uint hStride);
void SetSrcRegion(uint srcNum, uint vStride, uint width, uint hStride, e_instance instance = EINSTANCE_UNSPECIFIED);
void SetDstRegion(uint hStride);
inline void SetNoMask();
inline void SetMask(e_mask mask);
......@@ -347,7 +347,7 @@ public:
void Init();
void Push();
void SetFloatDenormMode(VISAKernel* vKernel, Float_DenormMode mode16,
void SetFloatDenormMode(VISAKernel* vKernel, Float_DenormMode mode16,
Float_DenormMode mode32, Float_DenormMode mode64);
void SetVectorMask(bool vMask);
// RM bits in CR0.0.
......@@ -378,17 +378,17 @@ public:
static uint GetCISADataTypeSize(VISA_Type type);
static e_alignment GetCISADataTypeAlignment(VISA_Type type);
static VISASampler3DSubOpCode ConvertSubOpcode(EOPCODE subOpcode, bool zeroLOD);
// Wrappers for (potentially) common queries on types
static bool IsIntegerType(VISA_Type type);
static bool IsFloatType(VISA_Type type);
void SetVISAWaTable(WA_TABLE const& waTable);
/// \brief Initialize per function states and starts vISA emission
/// \brief Initialize per function states and starts vISA emission
/// as a vISA subroutine
void BeginSubroutine(llvm::Function *F);
/// \brief Initialize per function states and starts vISA emission
/// \brief Initialize per function states and starts vISA emission
/// as a vISA stack-call function
void BeginStackFunction(llvm::Function *F);
......@@ -418,40 +418,34 @@ private:
void GetRowAndColOffset(CVariable* var, unsigned int subVar, unsigned int subreg, unsigned char& rowOff, unsigned char& colOff);
VISA_GenVar* GetVISAVariable(CVariable* var);
VISA_GenVar* GetVISAVariable(CVariable* var, e_instance instance);
Common_VISA_EMask_Ctrl ConvertMaskToVisaType(e_mask mask, bool noMask);
// Generic encoding functions
void MinMax(CISA_MIN_MAX_SUB_OPCODE subopcode, CVariable* dst, CVariable* src0, CVariable* src1);
void DataMov(ISA_Opcode opcode, CVariable* dst, CVariable* src);
void LogicOp(
ISA_Opcode opcode,
CVariable* dst,
CVariable* src0,
CVariable* src1 = nullptr,
ISA_Opcode opcode,
CVariable* dst,
CVariable* src0,
CVariable* src1 = nullptr,
CVariable* src2 = nullptr,
CVariable* src3 = nullptr);
void Arithmetic(
ISA_Opcode opcode,
CVariable* dst,
CVariable* src0 = nullptr,
CVariable* src1 = nullptr,
ISA_Opcode opcode,
CVariable* dst,
CVariable* src0 = nullptr,
CVariable* src1 = nullptr,
CVariable* src2 = nullptr);
void CarryBorrowArith(ISA_Opcode opcode, CVariable* dst, CVariable* src0, CVariable*src1);
void ScatterGather(
ISA_Opcode opcode,
CVariable* srcdst,
CVariable* bufId,
CVariable* offset,
CVariable* gOffset,
e_predefSurface surface,
int elementSize);
void ScatterGather4(
ISA_Opcode opcode,
CVariable* srcdst,
CVariable* bufId,
CVariable* offset,
CVariable* gOffset,
e_predefSurface surface);
e_predefSurface surface,
int elementSize);
void TypedReadWrite(
ISA_Opcode opcode,
const ResourceDescriptor& resource,
......@@ -508,7 +502,7 @@ protected:
VISAKernel* vKernel;
VISAKernel* vMainKernel;
VISABuilder* vbuilder;
bool m_enableVISAdump;
std::vector<VISA_LabelOpnd*> labelMap;
......@@ -581,7 +575,7 @@ inline void CEncoder::Add(CVariable* dst, CVariable* src0, CVariable* src1)
{
Arithmetic(ISA_ADD, dst, src0, src1);
}
inline void CEncoder::Shl(CVariable* dst, CVariable* src0, CVariable* src1)
{
LogicOp(ISA_SHL, dst, src0, src1);
......@@ -737,7 +731,7 @@ inline void CEncoder::UAddC(CVariable* dst, CVariable* src0, CVariable* src1)
inline void CEncoder::USubB(CVariable* dst, CVariable* src0, CVariable* src1)
{
CarryBorrowArith(ISA_SUBB, dst, src0, src1);
}
}
inline void CEncoder::LoadMS(EOPCODE subOpcode, uint writeMask, CVariable* offset,
const ResourceDescriptor& resource, uint numSources, CVariable* dst,
......@@ -751,11 +745,6 @@ inline void CEncoder::Gather(CVariable* dst, CVariable* bufId, CVariable* offset
ScatterGather(ISA_GATHER, dst, bufId, offset, gOffset, surface, elementSize);
}
inline void CEncoder::Gather4(CVariable* dst, CVariable* bufId, CVariable* offset, e_predefSurface surface)
{
ScatterGather4(ISA_GATHER4, dst, bufId, offset, nullptr, surface);
}
inline void CEncoder::TypedRead4(const ResourceDescriptor& resource, CVariable* pU, CVariable* pV,
CVariable* pR, CVariable* pLOD, CVariable* pDst, uint writeMask)
{
......@@ -773,11 +762,6 @@ inline void CEncoder::Scatter(CVariable* val, CVariable* bufidx, CVariable* offs
ScatterGather(ISA_SCATTER, val, bufidx, offset, gOffset, surface, elementSize);
}
inline void CEncoder::Scatter4(CVariable* val, CVariable* bufIdx, CVariable* offset, CVariable* gOffset, e_predefSurface surface)
{
ScatterGather4(ISA_SCATTER4, val, bufIdx, offset, gOffset, surface);
}
inline void CEncoder::SendC(CVariable* dst, CVariable* src, uint exDesc, CVariable* messDescriptor)
{
Send(dst, src, exDesc, messDescriptor, true);
......
......@@ -183,6 +183,13 @@ enum e_barrierKind : unsigned char
EBARRIER_WAIT
};
enum e_instance : unsigned char
{
EINSTANCE_UNSPECIFIED,
EINSTANCE_FIRST_HALF,
EINSTANCE_SECOND_HALF
};
class CVariable;
struct ResourceDescriptor
......
......@@ -70,6 +70,7 @@ set(IGC_BUILD__SRC__CISACodeGen_Common
"${CMAKE_CURRENT_SOURCE_DIR}/ShaderCodeGen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Simd32Profitability.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/TypeDemote.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/UniformAssumptions.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/VariableReuseAnalysis.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/TranslationTable.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/VectorPreProcess.cpp"
......@@ -158,6 +159,7 @@ set(IGC_BUILD__HDR__CISACodeGen_Common
"${CMAKE_CURRENT_SOURCE_DIR}/Simd32Profitability.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/TranslationTable.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/TypeDemote.h"
"${CMAKE_CURRENT_SOURCE_DIR}/UniformAssumptions.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/VariableReuseAnalysis.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/VectorProcess.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/VertexShaderCodeGen.hpp"
......
......@@ -105,7 +105,6 @@ void CShader::InitEncoder(SIMDMode simdSize, bool canAbortOnSpill, ShaderDispatc
m_dispatchSize = simdSize;
globalSymbolMapping.clear();
symbolMapping.clear();
phiMapping.clear();
rootMapping.clear();
ccTupleMapping.clear();
ConstantPool.clear();
......@@ -1801,7 +1800,6 @@ void CShader::BeginFunction(llvm::Function *F)
{
// TODO: merge InitEncoder with this function.
symbolMapping.clear();
phiMapping.clear();
rootMapping.clear();
ccTupleMapping.clear();
ConstantPool.clear();
......@@ -2283,6 +2281,24 @@ CVariable* CShader::GetSymbol(llvm::Value *value, bool fromConstantPool)
return it->second;
}
if (IGC_IS_FLAG_ENABLED(EnableDeSSAAlias) && m_deSSA->isAlias(value))
{
// Generate CVariable alias.
// Value and its aliasee must be of the same size.
Value* Aliasee = m_deSSA->getAliasee(value);
CVariable *Base = GetSymbol(Aliasee);
if (Aliasee == value) {
return Base;
}
Type *Ty = value->getType();
VectorType* VTy = dyn_cast<VectorType>(Ty);
Type *BTy = VTy ? VTy->getElementType() : Ty;
VISA_Type visaTy = GetType(BTy);
CVariable* AliasVar = GetNewAlias(Base, visaTy, 0, Base->GetNumberElement());
symbolMapping.insert(std::pair<llvm::Value*, CVariable*>(value, AliasVar));
return AliasVar;
}
if (IGC_IS_FLAG_ENABLED(EnableVariableAlias))
{
if (m_VRA->m_ValueAliasMap.count(value))
......@@ -2495,35 +2511,6 @@ CVariable* CShader::GetSymbol(llvm::Value *value, bool fromConstantPool)
return var;
}
CVariable* CShader::GetPhiTemp(llvm::PHINode* node)
{
if (IGC_IS_FLAG_ENABLED(DisablePHIDstCopy))
{
return GetSymbol(node);
}
CVariable* var = NULL;
auto it = phiMapping.find(node);
// find the mapping, return
if( it != phiMapping.end() )
{
return it->second;
}
// 1) simple de-ssa, always return a new temp
// 2) Or, phi is isolated, return a new temp
if (!m_deSSA || m_deSSA->isPHIIsolated(node))
{
var = GetNewVector(node);
}
else
{
// return the mapping of the dest-value
var = GetSymbol(node);
}
phiMapping.insert(std::pair<llvm::PHINode*,CVariable*>(node, var));
return var;
}
/// WHEN implement vector-coalescing, want to be more conservative in
/// treating extract-element as alias in order to reduce the complexity of
/// the problem
......
......@@ -81,6 +81,7 @@ CheckInstrTypes::CheckInstrTypes(IGC::SInstrTypes* instrList) : FunctionPass(ID)
instrList->hasBarrier = false;
instrList->hasDiscard = false;
instrList->mayHaveIndirectOperands = false;
instrList->hasUniformAssumptions = false;
instrList->numSample = 0;
instrList->numBB = 0;
instrList->numLoopInsts = 0;
......@@ -205,6 +206,9 @@ void CheckInstrTypes::visitCallInst(CallInst &C)
case GenISAIntrinsic::GenISA_threadgroupbarrier:
g_InstrTypes->hasBarrier = true;
break;
case GenISAIntrinsic::GenISA_is_uniform:
g_InstrTypes->hasUniformAssumptions = true;
break;
default:
break;
}
......
......@@ -727,6 +727,14 @@ void CoalescingEngine::PrepareInsertionSlot(
}
NewParent = ImmediateDominatingParent[NewParent];
}
//it might turn out, that rootNode does not dominate 'inst'
//since it is in another branch of DT
//do not forget to delete it as well
if (getRegRoot(RootNode->value)) {
isolateReg(RootNode->value);
}
} else {
//Evict dominating parent from CC.
Value* NewParent = GetActualDominatingParent(RootNode->value, inst);
......
This diff is collapsed.
......@@ -100,6 +100,8 @@ class DeSSA : public llvm::FunctionPass {
PHISrcArgs.clear();
RegNodeMap.clear();
InsEltMap.clear();
PrefCCMap.clear();
AliasMap.clear();
}
virtual llvm::StringRef getPassName() const override {
......@@ -110,11 +112,7 @@ class DeSSA : public llvm::FunctionPass {
/// return 0 if reg is isolated, and not in any insert-element union
llvm::Value* getRootValue(llvm::Value*, e_alignment *pAlign = 0) const;
/// Get the union-root of the PHI dst-value. The root of a PHI-dst is 0 if
/// the PHI has been isolated, or the phi-dst has been reg-isolated
llvm::Value* getPHIRoot(llvm::Instruction*) const;
bool isPHIIsolated(llvm::Instruction*) const;
bool isIsolated(llvm::Value*) const;
bool isUniform(llvm::Value *v) const {
return (WIA->whichDepend(v) == WIAnalysis::UNIFORM);
......@@ -142,20 +140,16 @@ class DeSSA : public llvm::FunctionPass {
/// congruence class may no longer logically be a member, due to being
/// isolated.
struct Node {
enum Flags {
kRegisterIsolatedFlag = 1,
kPHIIsolatedFlag = 1
};
Node(llvm::Value *v, int c, e_alignment align)
: next(this), prev(this), value(v)
: parent(this), next(this), prev(this), value(v)
, rank(0), alignment(align), color(c)
{
parent.setPointer(this);
}
/// Find leader (representative of a congruent class) by path halving
Node *getLeader();
llvm::PointerIntPair<Node*, 2> parent;
Node* parent;
// double-linked circular list. All values are in the same congruent class
// except those that have been isolated.
Node *next;
......@@ -170,35 +164,20 @@ class DeSSA : public llvm::FunctionPass {
int color;
};
/// Add a register in a new congruence class containing only itself.
void MapAddReg(llvm::MapVector<llvm::Value*, Node*> &map, llvm::Value *Val, e_alignment Align);
/// Join the congruence classes of two registers. This function is biased
/// towards the left argument, i.e. after
///
/// addReg(r2);
/// unionRegs(r1, r2);
///
/// the leader of the unioned congruence class is the same as the leader of
/// r1's congruence class prior to the union. This is actually relied upon
/// in the copy insertion code.
void MapUnionRegs(llvm::MapVector<llvm::Value*, Node*> &map, llvm::Value *, llvm::Value *);
/// Get the union-root of a register. The root is 0 if the register has been
/// isolated.
llvm::Value* getRegRoot(llvm::Value*, e_alignment *pAlign = 0) const;
/// Get the union-root of a PHI. it is the original root of its destination and
/// all of its operands (before they were isolated if they were).
llvm::Value* getOrigRoot(llvm::Instruction*) const;
// Return color (>0) if V is in a congruent class; return 0 otherwise.
// (This is needed during traversal of algo. The color is used as the
// reprentative of a congruent class that remains unchanged during traversal.)
int getRootColor(llvm::Value* V);
// Isolate a register.
void isolateReg(llvm::Value*);
/// Isolate a PHI.
void isolatePHI(llvm::Instruction*);
/// Is it isolated (single-valued congruent class)
bool isIsolated(Node* N) const { return (N == N->next); }
// Split node from its existing congurent class, and
// node itself becomes a new single-value congruent class
......@@ -261,16 +240,56 @@ public:
// with a single-node in phi-union. When being isolated, they are isolated together
llvm::MapVector<llvm::Value*, llvm::Value*> InsEltMap;
void addReg(llvm::Value* Val, e_alignment Align) {
MapAddReg(RegNodeMap, Val, Align);
}
// Preferred Congruent Class Map