Skip to content

Commit 5203782

Browse files
aparshin-inteligcbot
authored andcommitted
minor cosmetic refactoring to CMImpParam pass
---------------------------
1 parent ff9ce8a commit 5203782

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

IGC/VectorCompiler/lib/GenXOpts/CMTrans/CMImpParam.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ struct CMImpParam : public ModulePass {
295295
getImplicitUseInfo(F).addImplicit(IID);
296296
}
297297

298-
GlobalVariable *getIIDGlobal(Function *F, unsigned IID) {
298+
GlobalVariable *getOrCreateGlobalForIID(Function *F, unsigned IID) {
299299
if (GlobalsMap.count(IID))
300300
return GlobalsMap[IID];
301301

@@ -311,7 +311,7 @@ struct CMImpParam : public ModulePass {
311311
return NewVar;
312312
}
313313

314-
Type *getIntrinRetType(LLVMContext &Context, unsigned IID) {
314+
static Type *getIntrinRetType(LLVMContext &Context, unsigned IID) {
315315
switch (IID) {
316316
case GenXIntrinsic::genx_print_buffer:
317317
return llvm::Type::getInt64Ty(Context);
@@ -403,7 +403,8 @@ bool CMImpParam::runOnModule(Module &M) {
403403
// Replace the given instruction with a load from a global
404404
// The method erases the original call instruction.
405405
void CMImpParam::replaceWithGlobal(CallInst *CI, unsigned IID) {
406-
GlobalVariable *GV = getIIDGlobal(CI->getParent()->getParent(), IID);
406+
GlobalVariable *GV =
407+
getOrCreateGlobalForIID(CI->getParent()->getParent(), IID);
407408
LoadInst *Load = new LoadInst(GV->getType()->getPointerElementType(), GV, "",
408409
/* isVolatile */ false, CI);
409410
Load->takeName(CI);

0 commit comments

Comments
 (0)