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 @@ -2163,16 +2163,11 @@ bool lowerBuiltinCallsToVariables(Module *M) {
2163
2163
for (auto *U : F.users ()) {
2164
2164
auto *CI = dyn_cast<CallInst>(U);
2165
2165
assert (CI && " invalid instruction" );
2166
- const DebugLoc &DLoc = CI->getDebugLoc ();
2167
- Instruction *NewValue = new LoadInst (GVType, BV, " " , CI);
2168
- if (DLoc)
2169
- NewValue->setDebugLoc (DLoc);
2166
+ IRBuilder<> Builder (CI);
2167
+ Value *NewValue = Builder.CreateLoad (GVType, BV);
2170
2168
LLVM_DEBUG (dbgs () << " Transform: " << *CI << " => " << *NewValue << ' \n ' );
2171
2169
if (IsVec) {
2172
- NewValue =
2173
- ExtractElementInst::Create (NewValue, CI->getArgOperand (0 ), " " , CI);
2174
- if (DLoc)
2175
- NewValue->setDebugLoc (DLoc);
2170
+ NewValue = Builder.CreateExtractElement (NewValue, CI->getArgOperand (0 ));
2176
2171
LLVM_DEBUG (dbgs () << *NewValue << ' \n ' );
2177
2172
}
2178
2173
NewValue->takeName (CI);
You can’t perform that action at this time.
0 commit comments