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 @@ -2184,16 +2184,11 @@ bool lowerBuiltinCallsToVariables(Module *M) {
21842184 for (auto *U : F.users ()) {
21852185 auto *CI = dyn_cast<CallInst>(U);
21862186 assert (CI && " invalid instruction" );
2187- const DebugLoc &DLoc = CI->getDebugLoc ();
2188- Instruction *NewValue = new LoadInst (GVType, BV, " " , CI->getIterator ());
2189- if (DLoc)
2190- NewValue->setDebugLoc (DLoc);
2187+ IRBuilder<> Builder (CI);
2188+ Value *NewValue = Builder.CreateLoad (GVType, BV);
21912189 LLVM_DEBUG (dbgs () << " Transform: " << *CI << " => " << *NewValue << ' \n ' );
21922190 if (IsVec) {
2193- NewValue = ExtractElementInst::Create (NewValue, CI->getArgOperand (0 ),
2194- " " , CI->getIterator ());
2195- if (DLoc)
2196- NewValue->setDebugLoc (DLoc);
2191+ NewValue = Builder.CreateExtractElement (NewValue, CI->getArgOperand (0 ));
21972192 LLVM_DEBUG (dbgs () << *NewValue << ' \n ' );
21982193 }
21992194 NewValue->takeName (CI);
You can’t perform that action at this time.
0 commit comments