aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2021-04-06 13:17:35 -0700
committerPhilip Reames <listmail@philipreames.com>2021-04-06 13:18:53 -0700
commit908215b34636f579533ecd6671bb6213b8327dbc (patch)
tree44e7890700588401ab652686a4231604bc0195fd /llvm/lib/CodeGen/CodeGenPrepare.cpp
parent69190f95b1698cec8366ad657000b275c2039c1b (diff)
downloadllvm-908215b34636f579533ecd6671bb6213b8327dbc.zip
llvm-908215b34636f579533ecd6671bb6213b8327dbc.tar.gz
llvm-908215b34636f579533ecd6671bb6213b8327dbc.tar.bz2
Use AssumeInst in a few more places [nfc]
Follow up to a6d2a8d6f5. These were found by simply grepping for "::assume", and are the subset of that result which looked cleaner to me using the isa/dyn_cast patterns.
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 7e05b30..d4702820 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -626,12 +626,10 @@ bool CodeGenPrepare::eliminateAssumptions(Function &F) {
CurInstIterator = BB.begin();
while (CurInstIterator != BB.end()) {
Instruction *I = &*(CurInstIterator++);
- if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(I)) {
- if (II->getIntrinsicID() != Intrinsic::assume)
- continue;
+ if (auto *Assume = dyn_cast<AssumeInst>(I)) {
MadeChange = true;
- Value *Operand = II->getOperand(0);
- II->eraseFromParent();
+ Value *Operand = Assume->getOperand(0);
+ Assume->eraseFromParent();
resetIteratorIfInvalidatedWhileCalling(&BB, [&]() {
RecursivelyDeleteTriviallyDeadInstructions(Operand, TLInfo, nullptr);