diff options
author | Philip Reames <listmail@philipreames.com> | 2021-04-06 11:11:44 -0700 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2021-04-06 11:16:22 -0700 |
commit | a6d2a8d6f59a974752666305c4baaabebee41b95 (patch) | |
tree | fd78a01447da0dc40916251620efc2214465be3e /llvm/lib/Transforms/Utils/LoopUnroll.cpp | |
parent | 3b1b1d7530e6cf2c3aac25fc9d079f083e929137 (diff) | |
download | llvm-a6d2a8d6f59a974752666305c4baaabebee41b95.zip llvm-a6d2a8d6f59a974752666305c4baaabebee41b95.tar.gz llvm-a6d2a8d6f59a974752666305c4baaabebee41b95.tar.bz2 |
Add a subclass of IntrinsicInst for llvm.assume [nfc]
Add the subclass, update a few places which check for the intrinsic to use idiomatic dyn_cast, and update the public interface of AssumptionCache to use the new class. A follow up change will do the same for the newer assumption query/bundle mechanisms.
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnroll.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUnroll.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUnroll.cpp b/llvm/lib/Transforms/Utils/LoopUnroll.cpp index d4cd574..893b918 100644 --- a/llvm/lib/Transforms/Utils/LoopUnroll.cpp +++ b/llvm/lib/Transforms/Utils/LoopUnroll.cpp @@ -681,13 +681,10 @@ LoopUnrollResult llvm::UnrollLoop(Loop *L, UnrollLoopOptions ULO, LoopInfo *LI, // Remap all instructions in the most recent iteration remapInstructionsInBlocks(NewBlocks, LastValueMap); - for (BasicBlock *NewBlock : NewBlocks) { - for (Instruction &I : *NewBlock) { - if (auto *II = dyn_cast<IntrinsicInst>(&I)) - if (II->getIntrinsicID() == Intrinsic::assume) - AC->registerAssumption(II); - } - } + for (BasicBlock *NewBlock : NewBlocks) + for (Instruction &I : *NewBlock) + if (auto *II = dyn_cast<AssumeInst>(&I)) + AC->registerAssumption(II); { // Identify what other metadata depends on the cloned version. After |