Skip to content

Commit 885fc99

Browse files
scottp101igcbot
authored andcommitted
small refactor
small refactor
1 parent 945aad6 commit 885fc99

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

IGC/AdaptorOCL/UnifyIROCL.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ static void CommonOCLBasedPasses(OpenCLProgramContext *pContext) {
199199

200200
COMPILER_TIME_START(pContext, TIME_UnificationPasses);
201201

202+
setupTriple(*pContext);
203+
202204
pContext->metrics.Init(&pContext->hash, pContext->getModule()->getNamedMetadata("llvm.dbg.cu") != nullptr);
203205
pContext->metrics.CollectFunctions(pContext->getModule());
204206

IGC/Compiler/CISACodeGen/helper.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2374,6 +2374,9 @@ void appendToUsed(llvm::Module &M, ArrayRef<GlobalValue *> Values) {
23742374
GV->setSection("llvm.metadata");
23752375
}
23762376

2377+
void setupTriple(CodeGenContext &Ctx, StringRef OS) {
2378+
}
2379+
23772380
bool safeScheduleUp(llvm::BasicBlock *BB, llvm::Value *V, llvm::Instruction *&InsertPos,
23782381
llvm::DenseSet<llvm::Instruction *> Scheduled) {
23792382
llvm::Instruction *I = llvm::dyn_cast<llvm::Instruction>(V);

IGC/Compiler/CISACodeGen/helper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,8 @@ inline float GetThreadOccupancyPerSubslice(SIMDMode simdMode, unsigned threadGro
474474
// Global can now be any pointer type that uses addrspace
475475
void appendToUsed(llvm::Module &M, llvm::ArrayRef<llvm::GlobalValue *> Values);
476476

477+
void setupTriple(CodeGenContext &Ctx, llvm::StringRef OS = "");
478+
477479
bool safeScheduleUp(llvm::BasicBlock *BB, llvm::Value *V, llvm::Instruction *&InsertPos,
478480
llvm::DenseSet<llvm::Instruction *> Scheduled);
479481

IGC/GenISAIntrinsics/GenIntrinsicFunctions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ SPDX-License-Identifier: MIT
66
77
============================= end_copyright_notice ===========================*/
88

9-
#include "common/igc_regkeys.hpp"
109
#include "GenIntrinsicFunctions.h"
1110
#include "GenIntrinsicDefinition.h"
1211
#include "GenIntrinsicLookup.h"
@@ -128,7 +127,7 @@ template <llvm::GenISAIntrinsic::ID id> class IntrinsicFunctionImp : public llvm
128127
llvm::LLVMContext &ctx = module.getContext();
129128
std::string funcName = GetName(overloadedTypes, overloadedPointeeTys);
130129
llvm::FunctionType *pFuncType = GetType(ctx, overloadedTypes);
131-
llvm::AttributeList attribs = GetAttributeList(ctx, overloadedPointeeTys);
130+
llvm::AttributeList attribs = GetAttributeList(module, overloadedPointeeTys);
132131
// There can never be multiple globals with the same name of different types,
133132
// because intrinsics must be a specific type.
134133
IGCLLVM::Module &M = static_cast<IGCLLVM::Module &>(module);
@@ -195,8 +194,9 @@ template <llvm::GenISAIntrinsic::ID id> class IntrinsicFunctionImp : public llvm
195194
return llvm::FunctionType::get(resultTy, argTys, false);
196195
}
197196

198-
static llvm::AttributeList GetAttributeList(llvm::LLVMContext &ctx,
197+
static llvm::AttributeList GetAttributeList(llvm::Module &M,
199198
const llvm::ArrayRef<llvm::Type *> &overloadedPointeeTys) {
199+
auto &ctx = M.getContext();
200200
// 1. Instantiate regular attributes for the given intrinsic
201201
llvm::ArrayRef<llvm::Attribute::AttrKind> attributeKinds = IntrinsicDefinitionT::scAttributeKinds;
202202

0 commit comments

Comments
 (0)