Skip to content

Commit 565b56a

Browse files
committed
[NFC] Clean up uses of LoadInst constructor.
1 parent f30ebf4 commit 565b56a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

llvm/examples/BrainF/BrainF.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,8 @@ void BrainF::readloop(PHINode *phi, BasicBlock *oldbb, BasicBlock *testbb,
440440
Value *head_0 = phi;
441441

442442
//%tape.%d = load i8 *%head.%d
443-
LoadInst *tape_0 = new LoadInst(head_0, tapereg, testbb);
443+
LoadInst *tape_0 = new LoadInst(IntegerType::getInt8Ty(C), head_0,
444+
tapereg, testbb);
444445

445446
//%test.%d = icmp eq i8 %tape.%d, 0
446447
ICmpInst *test_0 = new ICmpInst(*testbb, ICmpInst::ICMP_EQ, tape_0,

llvm/lib/Target/BPF/BPFAbstractMemberAccess.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -878,8 +878,8 @@ bool BPFAbstractMemberAccess::transformGEPChain(Module &M, CallInst *Call,
878878

879879
if (CInfo.Kind == BPFPreserveFieldInfoAI) {
880880
// Load the global variable which represents the returned field info.
881-
auto *LDInst = new LoadInst(Type::getInt32Ty(BB->getContext()), GV);
882-
BB->getInstList().insert(Call->getIterator(), LDInst);
881+
auto *LDInst = new LoadInst(Type::getInt32Ty(BB->getContext()), GV, "",
882+
Call);
883883
Call->replaceAllUsesWith(LDInst);
884884
Call->eraseFromParent();
885885
return true;
@@ -896,8 +896,7 @@ bool BPFAbstractMemberAccess::transformGEPChain(Module &M, CallInst *Call,
896896
// The original Call inst is removed.
897897

898898
// Load the global variable.
899-
auto *LDInst = new LoadInst(Type::getInt64Ty(BB->getContext()), GV);
900-
BB->getInstList().insert(Call->getIterator(), LDInst);
899+
auto *LDInst = new LoadInst(Type::getInt64Ty(BB->getContext()), GV, "", Call);
901900

902901
// Generate a BitCast
903902
auto *BCInst = new BitCastInst(Base, Type::getInt8PtrTy(BB->getContext()));

llvm/lib/Transforms/Utils/CodeExtractor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,9 +1169,9 @@ CallInst *CodeExtractor::emitCallAndSwitchStatement(Function *newFunction,
11691169
Output = ReloadOutputs[i];
11701170
}
11711171
LoadInst *load = new LoadInst(outputs[i]->getType(), Output,
1172-
outputs[i]->getName() + ".reload");
1172+
outputs[i]->getName() + ".reload",
1173+
codeReplacer);
11731174
Reloads.push_back(load);
1174-
codeReplacer->getInstList().push_back(load);
11751175
std::vector<User *> Users(outputs[i]->user_begin(), outputs[i]->user_end());
11761176
for (unsigned u = 0, e = Users.size(); u != e; ++u) {
11771177
Instruction *inst = cast<Instruction>(Users[u]);

0 commit comments

Comments
 (0)