File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -2117,16 +2117,11 @@ bool lowerBuiltinCallsToVariables(Module *M) {
21172117 for (auto *U : F.users ()) {
21182118 auto *CI = dyn_cast<CallInst>(U);
21192119 assert (CI && " invalid instruction" );
2120- const DebugLoc &DLoc = CI->getDebugLoc ();
2121- Instruction *NewValue = new LoadInst (GVType, BV, " " , CI);
2122- if (DLoc)
2123- NewValue->setDebugLoc (DLoc);
2120+ IRBuilder<> Builder (CI);
2121+ Value *NewValue = Builder.CreateLoad (GVType, BV);
21242122 LLVM_DEBUG (dbgs () << " Transform: " << *CI << " => " << *NewValue << ' \n ' );
21252123 if (IsVec) {
2126- NewValue =
2127- ExtractElementInst::Create (NewValue, CI->getArgOperand (0 ), " " , CI);
2128- if (DLoc)
2129- NewValue->setDebugLoc (DLoc);
2124+ NewValue = Builder.CreateExtractElement (NewValue, CI->getArgOperand (0 ));
21302125 LLVM_DEBUG (dbgs () << *NewValue << ' \n ' );
21312126 }
21322127 NewValue->takeName (CI);
You can’t perform that action at this time.
0 commit comments