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 @@ -2117,16 +2117,11 @@ bool lowerBuiltinCallsToVariables(Module *M) {
2117
2117
for (auto *U : F.users ()) {
2118
2118
auto *CI = dyn_cast<CallInst>(U);
2119
2119
assert (CI && " invalid instruction" );
2120
- const DebugLoc &DLoc = CI->getDebugLoc ();
2121
- Instruction *NewValue = new LoadInst (GVType, BV, " " , CI);
2122
- if (DLoc)
2123
- NewValue->setDebugLoc (DLoc);
2120
+ IRBuilder<> Builder (CI);
2121
+ Value *NewValue = Builder.CreateLoad (GVType, BV);
2124
2122
LLVM_DEBUG (dbgs () << " Transform: " << *CI << " => " << *NewValue << ' \n ' );
2125
2123
if (IsVec) {
2126
- NewValue =
2127
- ExtractElementInst::Create (NewValue, CI->getArgOperand (0 ), " " , CI);
2128
- if (DLoc)
2129
- NewValue->setDebugLoc (DLoc);
2124
+ NewValue = Builder.CreateExtractElement (NewValue, CI->getArgOperand (0 ));
2130
2125
LLVM_DEBUG (dbgs () << *NewValue << ' \n ' );
2131
2126
}
2132
2127
NewValue->takeName (CI);
You can’t perform that action at this time.
0 commit comments