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