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