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/InlineFunction.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/InlineFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/InlineFunction.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index e754721..60fc5b2 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -1296,7 +1296,7 @@ static void AddAlignmentAssumptions(CallBase &CB, InlineFunctionInfo &IFI) { CallInst *NewAsmp = IRBuilder<>(&CB).CreateAlignmentAssumption(DL, ArgVal, Align); - AC->registerAssumption(NewAsmp); + AC->registerAssumption(cast<AssumeInst>(NewAsmp)); } } } @@ -2050,9 +2050,8 @@ llvm::InlineResult llvm::InlineFunction(CallBase &CB, InlineFunctionInfo &IFI, for (BasicBlock &NewBlock : make_range(FirstNewBlock->getIterator(), Caller->end())) for (Instruction &I : NewBlock) - if (auto *II = dyn_cast<IntrinsicInst>(&I)) - if (II->getIntrinsicID() == Intrinsic::assume) - IFI.GetAssumptionCache(*Caller).registerAssumption(II); + if (auto *II = dyn_cast<AssumeInst>(&I)) + IFI.GetAssumptionCache(*Caller).registerAssumption(II); } // If there are any alloca instructions in the block that used to be the entry |