Commit 4af438f8 authored by Sohil Bammi's avatar Sohil Bammi Committed by gbsbuild

Removed InputIRVersionMD from both the old and new metadata framework,

using targetTriple() instead

Change-Id: I384595fe541f0dbdc73c5acff3eff395a2389790
parent f3442189
......@@ -472,22 +472,6 @@ void UnifyIRSPIR(
std::unique_ptr<llvm::Module> BuiltinGenericModule,
std::unique_ptr<llvm::Module> BuiltinSizeModule)
{
int pointerSize = getPointerSize(*pContext->getModule());
// Replace SPIR triple with IGC triple.
if(pointerSize == 4)
{
pContext->getModule()->setTargetTriple("vISA_32");
BuiltinGenericModule->setTargetTriple("vISA_32");
BuiltinSizeModule->setTargetTriple("vISA_32");
}
else // pointer size 64bit
{
pContext->getModule()->setTargetTriple("vISA_64");
BuiltinGenericModule->setTargetTriple("vISA_64");
BuiltinSizeModule->setTargetTriple("vISA_64");
}
CommonOCLBasedPasses(pContext, std::move(BuiltinGenericModule), std::move(BuiltinSizeModule));
}
}
......@@ -1005,160 +1005,6 @@ llvm::Metadata* ArgInfoMetaData::getImgAccessIntCoordsNode( const llvm::MDNode*
return NULL;
}
///
// Ctor - loads the InputIRVersionMetaData from the given metadata node
//
InputIRVersionMetaData::InputIRVersionMetaData(const llvm::MDNode* pNode, bool hasId):
_Mybase(pNode, hasId),
m_Name(getNameNode(pNode)),
m_Major(getMajorNode(pNode)),
m_Minor(getMinorNode(pNode)),
m_pNode(pNode)
{}
///
// Default Ctor - creates the empty, not named InputIRVersionMetaData object
//
InputIRVersionMetaData::InputIRVersionMetaData():
m_pNode(NULL)
{}
///
// Ctor - creates the empty, named InputIRVersionMetaData object
//
InputIRVersionMetaData::InputIRVersionMetaData(const char* name):
_Mybase(name),
m_pNode(NULL)
{}
bool InputIRVersionMetaData::hasValue() const
{
if (m_Name.hasValue())
{
return true;
}
if (m_Major.hasValue())
{
return true;
}
if (m_Minor.hasValue())
{
return true;
}
return NULL != m_pNode || dirty();
}
///
// Returns true if any of the InputIRVersionMetaData`s members has changed
bool InputIRVersionMetaData::dirty() const
{
if( m_Name.dirty() )
{
return true;
}
if( m_Major.dirty() )
{
return true;
}
if( m_Minor.dirty() )
{
return true;
}
return false;
}
///
// Discards the changes done to the InputIRVersionMetaData instance
void InputIRVersionMetaData::discardChanges()
{
m_Name.discardChanges();
m_Major.discardChanges();
m_Minor.discardChanges();
}
///
// Generates the new MDNode hierarchy for the given structure
llvm::Metadata* InputIRVersionMetaData::generateNode(llvm::LLVMContext& context) const
{
llvm::SmallVector<llvm::Metadata*, 5> args;
llvm::Metadata* pIDNode = _Mybase::generateNode(context);
if( NULL != pIDNode )
{
args.push_back(pIDNode);
}
args.push_back( m_Name.generateNode(context));
args.push_back( m_Major.generateNode(context));
args.push_back( m_Minor.generateNode(context));
return llvm::MDNode::get(context, args);
}
///
// Saves the structure changes to the given MDNode
void InputIRVersionMetaData::save(llvm::LLVMContext& context, llvm::MDNode* pNode) const
{
assert( pNode && "The target node should be valid pointer");
// we assume that underlying metadata node has not changed under our foot
if( pNode == m_pNode && !dirty() )
{
return;
}
#if 0
// check that we could save the new information to the given node without regenerating it
if( !compatibleWith(pNode) )
{
pNode->replaceAllUsesWith(generateNode(context));
return;
}
#endif
m_Name.save(context, llvm::cast<llvm::MDNode>(getNameNode(pNode)));
m_Major.save(context, llvm::cast<llvm::MDNode>(getMajorNode(pNode)));
m_Minor.save(context, llvm::cast<llvm::MDNode>(getMinorNode(pNode)));
}
llvm::Metadata* InputIRVersionMetaData::getNameNode( const llvm::MDNode* pParentNode) const
{
if( !pParentNode )
{
return NULL;
}
unsigned int offset = _Mybase::getStartIndex();
return pParentNode->getOperand(0 + offset).get();
}
llvm::Metadata* InputIRVersionMetaData::getMajorNode( const llvm::MDNode* pParentNode) const
{
if( !pParentNode )
{
return NULL;
}
unsigned int offset = _Mybase::getStartIndex();
return pParentNode->getOperand(1 + offset).get();
}
llvm::Metadata* InputIRVersionMetaData::getMinorNode( const llvm::MDNode* pParentNode) const
{
if( !pParentNode )
{
return NULL;
}
unsigned int offset = _Mybase::getStartIndex();
return pParentNode->getOperand(2 + offset).get();
}
///
// Ctor - loads the LocalOffsetMetaData from the given metadata node
//
......@@ -1286,7 +1132,6 @@ llvm::Metadata* LocalOffsetMetaData::getOffsetNode( const llvm::MDNode* pParentN
return pParentNode->getOperand(1 + offset).get();
}
///
// Ctor - loads the ArgDependencyInfoMetaData from the given metadata node
......@@ -3356,14 +3201,6 @@ llvm::MDNode* FunctionInfoMetaData::getOpenCLArgNamesNode(const llvm::MDNode* pP
return NULL;
}
///
// dtor
//MetaDataUtils::~MetaDataUtils()
//{
// // assert(!dirty() && "There were changes in the metadata hierarchy. Either save or discardChanges should be called");
//
//}
static bool isNamedNode(const llvm::Metadata* pNode, const char* name)
{
const llvm::MDNode* pMDNode = llvm::dyn_cast<llvm::MDNode>(pNode);
......
......@@ -42,9 +42,6 @@ typedef MetaObjectHandle<ArgAllocMetaData> ArgAllocMetaDataHandle;
class ArgInfoMetaData;
typedef MetaObjectHandle<ArgInfoMetaData> ArgInfoMetaDataHandle;
class InputIRVersionMetaData;
typedef MetaObjectHandle<InputIRVersionMetaData> InputIRVersionMetaDataHandle;
class LocalOffsetMetaData;
typedef MetaObjectHandle<LocalOffsetMetaData> LocalOffsetMetaDataHandle;
......@@ -78,9 +75,6 @@ typedef MetaObjectHandle<ArgAllocsMetaDataList> ArgAllocsMetaDataListHandle;
typedef MetaDataList<ArgInfoMetaDataHandle> ArgInfoListMetaDataList;
typedef MetaObjectHandle<ArgInfoListMetaDataList> ArgInfoListMetaDataListHandle;
typedef MetaDataList<InputIRVersionMetaDataHandle> InputIRVersionsMetaDataList;
typedef MetaObjectHandle<InputIRVersionsMetaDataList> InputIRVersionsMetaDataListHandle;
typedef MetaDataList<LocalOffsetMetaDataHandle> LocalOffsetsMetaDataList;
typedef MetaObjectHandle<LocalOffsetsMetaDataList> LocalOffsetsMetaDataListHandle;
......@@ -784,145 +778,6 @@ private:
const llvm::MDNode* m_pNode;
};
///
// Read/Write the InputIRVersion structure from/to LLVM metadata
//
class InputIRVersionMetaData:public IMetaDataObject
{
public:
typedef InputIRVersionMetaData _Myt;
typedef IMetaDataObject _Mybase;
// typedefs for data member types
typedef MetaDataValue<std::string>::value_type NameType;
typedef MetaDataValue<int32_t>::value_type MajorType;
typedef MetaDataValue<int32_t>::value_type MinorType;
public:
///
// Factory method - creates the InputIRVersionMetaData from the given metadata node
//
static _Myt* get(const llvm::MDNode* pNode, bool hasId = false)
{
return new _Myt(pNode, hasId);
}
///
// Factory method - create the default empty InputIRVersionMetaData object
static _Myt* get()
{
return new _Myt();
}
///
// Factory method - create the default empty named InputIRVersionMetaData object
static _Myt* get(const char* name)
{
return new _Myt(name);
}
///
// Ctor - loads the InputIRVersionMetaData from the given metadata node
//
InputIRVersionMetaData(const llvm::MDNode* pNode, bool hasId);
///
// Default Ctor - creates the empty, not named InputIRVersionMetaData object
//
InputIRVersionMetaData();
///
// Ctor - creates the empty, named InputIRVersionMetaData object
//
InputIRVersionMetaData(const char* name);
/// Name related methods
NameType getName() const
{
return m_Name.get();
}
void setName( const NameType& val)
{
m_Name.set(val);
}
bool isNameHasValue() const
{
return m_Name.hasValue();
}
/// Major related methods
MajorType getMajor() const
{
return m_Major.get();
}
void setMajor( const MajorType& val)
{
m_Major.set(val);
}
bool isMajorHasValue() const
{
return m_Major.hasValue();
}
/// Minor related methods
MinorType getMinor() const
{
return m_Minor.get();
}
void setMinor( const MinorType& val)
{
m_Minor.set(val);
}
bool isMinorHasValue() const
{
return m_Minor.hasValue();
}
///
// Returns true if any of the InputIRVersionMetaData`s members has changed
bool dirty() const;
///
// Returns true if the structure was loaded from the metadata or was changed
bool hasValue() const;
///
// Discards the changes done to the InputIRVersionMetaData instance
void discardChanges();
///
// Generates the new MDNode hierarchy for the given structure
llvm::Metadata* generateNode(llvm::LLVMContext& context) const;
///
// Saves the structure changes to the given MDNode
void save(llvm::LLVMContext& context, llvm::MDNode* pNode) const;
private:
///
// Returns true if the given MDNode could be saved to without replacement
bool compatibleWith( const llvm::MDNode* pNode) const
{
return false;
}
private:
typedef MetaDataIterator<llvm::MDNode> NodeIterator;
llvm::Metadata* getNameNode( const llvm::MDNode* pParentNode) const;
llvm::Metadata* getMajorNode( const llvm::MDNode* pParentNode) const;
llvm::Metadata* getMinorNode( const llvm::MDNode* pParentNode) const;
private:
// data members
MetaDataValue<std::string> m_Name;
MetaDataValue<int32_t> m_Major;
MetaDataValue<int32_t> m_Minor;
// parent node
const llvm::MDNode* m_pNode;
};
///
// Read/Write the LocalOffset structure from/to LLVM metadata
//
......@@ -3087,100 +2942,26 @@ private:
class MetaDataUtils
{
public:
// typedefs for the data members types
typedef NamedMDNodeList<InputIRVersionMetaDataHandle> InputIRVersionsList;
// typedefs for the data members types
typedef NamedMetaDataMap<llvm::Function, FunctionInfoMetaDataHandle> FunctionsInfoMap;
public:
// If using this constructor, setting the llvm module by the setModule
// function is needed for correct operation.
MetaDataUtils(){}
MetaDataUtils(llvm::Module* pModule):
m_InputIRVersions(pModule->getOrInsertNamedMetadata("igc.input.ir")),
m_FunctionsInfo(pModule->getOrInsertNamedMetadata("igc.functions")),
m_pModule(pModule)
{
}
void setModule(llvm::Module* pModule) {
m_InputIRVersions = pModule->getOrInsertNamedMetadata("igc.input.ir");
m_FunctionsInfo = pModule->getOrInsertNamedMetadata("igc.functions");
m_pModule = pModule;
}
~MetaDataUtils(){}
/// InputIRVersions related methods
void clearInputIRVersions()
{
m_InputIRVersions.clear();
}
void deleteInputIRVersions()
{
llvm::NamedMDNode* InputIRVersionsNode = m_pModule->getNamedMetadata("igc.input.ir");
if (InputIRVersionsNode)
{
m_nodesToDelete.push_back(InputIRVersionsNode);
}
}
InputIRVersionsList::iterator begin_InputIRVersions()
{
return m_InputIRVersions.begin();
}
InputIRVersionsList::iterator end_InputIRVersions()
{
return m_InputIRVersions.end();
}
InputIRVersionsList::const_iterator begin_InputIRVersions() const
{
return m_InputIRVersions.begin();
}
InputIRVersionsList::const_iterator end_InputIRVersions() const
{
return m_InputIRVersions.end();
}
size_t size_InputIRVersions() const
{
return m_InputIRVersions.size();
}
bool empty_InputIRVersions() const
{
return m_InputIRVersions.empty();
}
bool isInputIRVersionsHasValue() const
{
return m_InputIRVersions.hasValue();
}
InputIRVersionsList::item_type getInputIRVersionsItem( size_t index ) const
{
return m_InputIRVersions.getItem(index);
}
void setInputIRVersionsItem( size_t index, const InputIRVersionsList::item_type& item )
{
return m_InputIRVersions.setItem(index, item);
}
void addInputIRVersionsItem(const InputIRVersionsList::item_type& val)
{
m_InputIRVersions.push_back(val);
}
InputIRVersionsList::iterator eraseInputIRVersionsItem(InputIRVersionsList::iterator it)
{
return m_InputIRVersions.erase(it);
}
/// FunctionsInfo related methods
void clearFunctionsInfo()
{
......@@ -3258,27 +3039,9 @@ public:
{
m_FunctionsInfo.erase(it);
}
bool dirty()
{
if (m_InputIRVersions.dirty())
{
return true;
}
if( m_FunctionsInfo.dirty() )
{
return true;
}
return false;
}
void save(llvm::LLVMContext& context)
{
if (m_InputIRVersions.dirty())
{
llvm::NamedMDNode* pNode = m_pModule->getOrInsertNamedMetadata("igc.input.ir");
m_InputIRVersions.save(context, pNode);
}
if( m_FunctionsInfo.dirty() )
{
llvm::NamedMDNode* pNode = m_pModule->getOrInsertNamedMetadata("igc.functions");
......@@ -3296,19 +3059,12 @@ public:
void discardChanges()
{
m_InputIRVersions.discardChanges();
m_FunctionsInfo.discardChanges();
m_nodesToDelete.clear();
}
void deleteMetadata()
{
llvm::NamedMDNode* InputIRVersionsNode = m_pModule->getNamedMetadata("igc.input.ir");
if (InputIRVersionsNode)
{
m_nodesToDelete.push_back(InputIRVersionsNode);
}
llvm::NamedMDNode* FunctionsInfoNode = m_pModule->getNamedMetadata("igc.functions");
if (FunctionsInfoNode)
{
......@@ -3318,7 +3074,6 @@ public:
private:
// data members
NamedMDNodeList<InputIRVersionMetaDataHandle> m_InputIRVersions;
NamedMetaDataMap<llvm::Function, FunctionInfoMetaDataHandle> m_FunctionsInfo;
llvm::Module* m_pModule;
std::vector<llvm::NamedMDNode*> m_nodesToDelete;
......
......@@ -149,19 +149,17 @@ llvm::Metadata* VectorTypeHintMetaData::getVecTypeNode( const llvm::MDNode* pPar
return pParentNode->getOperand(0 + offset).get();
}
llvm::Metadata* VectorTypeHintMetaData::getSignNode( const llvm::MDNode* pParentNode) const
llvm::Metadata* VectorTypeHintMetaData::getSignNode(const llvm::MDNode* pParentNode) const
{
if( !pParentNode )
{
return NULL;
}
if (!pParentNode)
{
return NULL;
}
unsigned int offset = _Mybase::getStartIndex();
return pParentNode->getOperand(1 + offset).get();
unsigned int offset = _Mybase::getStartIndex();
return pParentNode->getOperand(1 + offset).get();
}
///
// Ctor - loads the VersionMetaData from the given metadata node
//
......
......@@ -772,7 +772,6 @@ void BIImport::removeFunctionBitcasts(Module &M)
void BIImport::InitializeBIFlags(Module &M)
{
auto mdUtils = getAnalysis<MetaDataUtilsWrapper>().getMetaDataUtils();
auto MD = *(getAnalysis<MetaDataUtilsWrapper>().getModuleMetaData());
auto pCtx = getAnalysis<CodeGenContextWrapper>().getCodeGenContext();
......@@ -797,7 +796,7 @@ void BIImport::InitializeBIFlags(Module &M)
initializeVarWithValue("__CRMacros",
pCtx->platform.hasCorrectlyRoundedMacros() ? 1 : 0);
if (mdUtils->isInputIRVersionsHasValue() && mdUtils->size_InputIRVersions() > 0)
if (StringRef(pCtx->getModule()->getTargetTriple()).size() > 0)
{
initializeVarWithValue("__APIRS", false);
}
......
......@@ -752,7 +752,8 @@ public:
void CreateInlineSamplerAnnotations(InlineSamplerMetaDataHandle inlineSamplerMD, int samplerValue)
{
inlineSamplerMD->setValue(samplerValue);
if (llvm::StringRef(m_pMdUtils->getInputIRVersionsItem(0)->getName()).startswith("ocl"))
Module* M = m_pCallInst->getParent()->getModule();
if (llvm::StringRef(M->getTargetTriple()).startswith("igil") || llvm::StringRef(M->getTargetTriple()).startswith("gpu_64"))
{
inlineSamplerMD->setAddressMode(samplerValue & LEGACY_SAMPLER_ADDRESS_MASK);
switch (samplerValue & LEGACY_SAMPLER_ADDRESS_MASK)
......@@ -818,7 +819,7 @@ public:
inlineSamplerMD->setBorderColorB(0.0f);
inlineSamplerMD->setBorderColorA(0.0f);
}
else if (llvm::StringRef(m_pMdUtils->getInputIRVersionsItem(0)->getName()).startswith("spir"))
else if (llvm::StringRef(M->getTargetTriple()).startswith("spir"))
{
switch (samplerValue & SPIR_SAMPLER_ADDRESS_MASK)
{
......@@ -988,7 +989,7 @@ protected:
class COCL_sample_l: public COCL_sample
{
public:
COCL_sample_l(ParamMap* paramMap, InlineMap* inlineMap, int* nextSampler, Dimension Dim, MetaDataUtils* pMdUtils) : COCL_sample(paramMap, inlineMap, nextSampler, Dim ,pMdUtils) {}
COCL_sample_l(ParamMap* paramMap, InlineMap* inlineMap, int* nextSampler, Dimension Dim, MetaDataUtils* pMdUtils) : COCL_sample(paramMap, inlineMap, nextSampler, Dim, pMdUtils) {}
void createIntrinsic()
{
......@@ -1010,7 +1011,7 @@ public:
class COCL_sample_d: public COCL_sample
{
public:
COCL_sample_d(ParamMap* paramMap, InlineMap* inlineMap, int* nextSampler, Dimension Dim, MetaDataUtils* pMdUtils) : COCL_sample(paramMap, inlineMap, nextSampler, Dim ,pMdUtils) {}
COCL_sample_d(ParamMap* paramMap, InlineMap* inlineMap, int* nextSampler, Dimension Dim, MetaDataUtils* pMdUtils) : COCL_sample(paramMap, inlineMap, nextSampler, Dim, pMdUtils) {}
void createIntrinsic()
{
......@@ -1515,16 +1516,16 @@ CBuiltinsResolver::CBuiltinsResolver(CImagesBI::ParamMap* paramMap, CImagesBI::I
m_CommandMap["__builtin_IB_OCL_2darr_ld2dms"] = initImageClass<COCL_ld2dms>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_2D_ARRAY);
m_CommandMap["__builtin_IB_OCL_2d_ld2dmsui"] = initImageClass<COCL_ld2dmsui>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_2D);
m_CommandMap["__builtin_IB_OCL_2darr_ld2dmsui"] = initImageClass<COCL_ld2dmsui>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_2D_ARRAY);
m_CommandMap["__builtin_IB_OCL_1d_sample_l"] = initSamplerClass<COCL_sample_l>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_1D, pMdUtils);
m_CommandMap["__builtin_IB_OCL_1d_sample_l"] = initSamplerClass<COCL_sample_l>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_1D, pMdUtils);
m_CommandMap["__builtin_IB_OCL_1darr_sample_l"] = initSamplerClass<COCL_sample_l>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_1D_ARRAY, pMdUtils);
m_CommandMap["__builtin_IB_OCL_2d_sample_l"] = initSamplerClass<COCL_sample_l>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_2D, pMdUtils);
m_CommandMap["__builtin_IB_OCL_2d_sample_l"] = initSamplerClass<COCL_sample_l>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_2D, pMdUtils);
m_CommandMap["__builtin_IB_OCL_2darr_sample_l"] = initSamplerClass<COCL_sample_l>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_2D_ARRAY, pMdUtils);
m_CommandMap["__builtin_IB_OCL_3d_sample_l"] = initSamplerClass<COCL_sample_l>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_3D, pMdUtils);
m_CommandMap["__builtin_IB_OCL_1d_sample_d"] = initSamplerClass<COCL_sample_d>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_1D, pMdUtils);
m_CommandMap["__builtin_IB_OCL_3d_sample_l"] = initSamplerClass<COCL_sample_l>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_3D, pMdUtils);
m_CommandMap["__builtin_IB_OCL_1d_sample_d"] = initSamplerClass<COCL_sample_d>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_1D, pMdUtils);
m_CommandMap["__builtin_IB_OCL_1darr_sample_d"] = initSamplerClass<COCL_sample_d>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_1D_ARRAY, pMdUtils);
m_CommandMap["__builtin_IB_OCL_2d_sample_d"] = initSamplerClass<COCL_sample_d>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_2D, pMdUtils);
m_CommandMap["__builtin_IB_OCL_2d_sample_d"] = initSamplerClass<COCL_sample_d>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_2D, pMdUtils);
m_CommandMap["__builtin_IB_OCL_2darr_sample_d"] = initSamplerClass<COCL_sample_d>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_2D_ARRAY, pMdUtils);
m_CommandMap["__builtin_IB_OCL_3d_sample_d"] = initSamplerClass<COCL_sample_d>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_3D, pMdUtils);
m_CommandMap["__builtin_IB_OCL_3d_sample_d"] = initSamplerClass<COCL_sample_d>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_3D, pMdUtils);
m_CommandMap["__builtin_IB_OCL_1d_sample_lui"] = initSamplerClass<COCL_sample_l>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_1D, pMdUtils);
m_CommandMap["__builtin_IB_OCL_1darr_sample_lui"] = initSamplerClass<COCL_sample_l>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_1D_ARRAY, pMdUtils);
m_CommandMap["__builtin_IB_OCL_2d_sample_lui"] = initSamplerClass<COCL_sample_l>(paramMap, inlineMap, nextSampler, CImagesBI::Dimension::DIM_2D, pMdUtils);
......
......@@ -57,7 +57,6 @@ ImageFuncResolution::ImageFuncResolution() : FunctionPass(ID), m_implicitArgs()
bool ImageFuncResolution::runOnFunction(Function &F) {
const MetaDataUtils* pMdUtils = getAnalysis<MetaDataUtilsWrapper>().getMetaDataUtils();
m_implicitArgs = ImplicitArgs(F, pMdUtils);
m_InputIRVersionMD = pMdUtils->getInputIRVersionsItem(0);
m_changed = false;
visit(F);
return m_changed;
......
......@@ -154,9 +154,6 @@ namespace IGC
/// @brief The implicit arguments of the current function
ImplicitArgs m_implicitArgs;
/// @brief The input IR version metadata information.
IGCMD::InputIRVersionMetaDataHandle m_InputIRVersionMD;
/// @brief Indicates if the pass changed the processed function
bool m_changed;
};
......
......@@ -157,35 +157,6 @@ bool SPIRMetaDataTranslation::runOnModule(Module& M)
}
}
// Handling Input IR format.
IGCMD::InputIRVersionMetaDataHandle iirvHandle = IGCMD::InputIRVersionMetaDataHandle(IGCMD::InputIRVersionMetaData::get());
if(llvm::StringRef(M.getTargetTriple()).startswith("igil") || llvm::StringRef(M.getTargetTriple()).startswith("gpu_64"))
{
iirvHandle->setName("ocl");
iirvHandle->setMajor(oclMajor);
iirvHandle->setMinor(oclMinor);
}
else if (StringRef(M.getTargetTriple()).startswith("vISA_"))
{
iirvHandle->setName("spir");
if (spirMDUtils.isSpirVersionsHasValue())
{
SPIRMD::VersionMetaDataHandle spirVersion = spirMDUtils.getSpirVersionsItem(0);
iirvHandle->setMajor(spirVersion->getMajor());
iirvHandle->setMinor(spirVersion->getMinor());
}
else
{
iirvHandle->setMajor(2);
iirvHandle->setMinor(0);
}
}
else
{
assert(0 && "Expected SPIR or OCL");
}
pIgcMDUtils->addInputIRVersionsItem(iirvHandle);
// Handling Functions
SPIRMD::SpirMetaDataUtils::KernelsList::const_iterator ki = spirMDUtils.begin_Kernels();
SPIRMD::SpirMetaDataUtils::KernelsList::const_iterator ke = spirMDUtils.end_Kernels();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment