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