@@ -295,7 +295,7 @@ struct CMImpParam : public ModulePass {
295
295
getImplicitUseInfo (F).addImplicit (IID);
296
296
}
297
297
298
- GlobalVariable *getIIDGlobal (Function *F, unsigned IID) {
298
+ GlobalVariable *getOrCreateGlobalForIID (Function *F, unsigned IID) {
299
299
if (GlobalsMap.count (IID))
300
300
return GlobalsMap[IID];
301
301
@@ -311,7 +311,7 @@ struct CMImpParam : public ModulePass {
311
311
return NewVar;
312
312
}
313
313
314
- Type *getIntrinRetType (LLVMContext &Context, unsigned IID) {
314
+ static Type *getIntrinRetType (LLVMContext &Context, unsigned IID) {
315
315
switch (IID) {
316
316
case GenXIntrinsic::genx_print_buffer:
317
317
return llvm::Type::getInt64Ty (Context);
@@ -403,7 +403,8 @@ bool CMImpParam::runOnModule(Module &M) {
403
403
// Replace the given instruction with a load from a global
404
404
// The method erases the original call instruction.
405
405
void CMImpParam::replaceWithGlobal (CallInst *CI, unsigned IID) {
406
- GlobalVariable *GV = getIIDGlobal (CI->getParent ()->getParent (), IID);
406
+ GlobalVariable *GV =
407
+ getOrCreateGlobalForIID (CI->getParent ()->getParent (), IID);
407
408
LoadInst *Load = new LoadInst (GV->getType ()->getPointerElementType (), GV, " " ,
408
409
/* isVolatile */ false , CI);
409
410
Load->takeName (CI);
0 commit comments