diff options
author | Max Kazantsev <mkazantsev@azul.com> | 2023-02-20 18:38:07 +0700 |
---|---|---|
committer | Max Kazantsev <mkazantsev@azul.com> | 2023-02-20 18:38:07 +0700 |
commit | 0cbb8ec030e23c0e13331b5d54155def8c901b36 (patch) | |
tree | 0597fc68b3703110cd721de2a3cbb048fccdc1a2 /llvm/lib/Transforms/Utils | |
parent | 3e84fc857f28479cd9574f72efcba7eb8f60d602 (diff) | |
download | llvm-0cbb8ec030e23c0e13331b5d54155def8c901b36.zip llvm-0cbb8ec030e23c0e13331b5d54155def8c901b36.tar.gz llvm-0cbb8ec030e23c0e13331b5d54155def8c901b36.tar.bz2 |
Revert "[AssumptionCache] caches @llvm.experimental.guard's"
This reverts commit f9599bbc7a3f831e1793a549d8a7a19265f3e504.
For some reason it caused us a huge compile time regression in downstream
workloads. Not sure whether the source of it is in upstream code ir not.
Temporarily reverting until investigated.
Differential Revision: https://reviews.llvm.org/D142330
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r-- | llvm/lib/Transforms/Utils/CodeExtractor.cpp | 14 | ||||
-rw-r--r-- | llvm/lib/Transforms/Utils/InlineFunction.cpp | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Utils/CodeExtractor.cpp b/llvm/lib/Transforms/Utils/CodeExtractor.cpp index 8e4006d..99d7038 100644 --- a/llvm/lib/Transforms/Utils/CodeExtractor.cpp +++ b/llvm/lib/Transforms/Utils/CodeExtractor.cpp @@ -1649,14 +1649,14 @@ CodeExtractor::extractCodeRegion(const CodeExtractorAnalysisCache &CEAC, } } - // Remove CondGuardInsts that will be moved to the new function from the old - // function's assumption cache. + // Remove @llvm.assume calls that will be moved to the new function from the + // old function's assumption cache. for (BasicBlock *Block : Blocks) { for (Instruction &I : llvm::make_early_inc_range(*Block)) { - if (auto *CI = dyn_cast<CondGuardInst>(&I)) { + if (auto *AI = dyn_cast<AssumeInst>(&I)) { if (AC) - AC->unregisterAssumption(CI); - CI->eraseFromParent(); + AC->unregisterAssumption(AI); + AI->eraseFromParent(); } } } @@ -1850,7 +1850,7 @@ bool CodeExtractor::verifyAssumptionCache(const Function &OldFunc, const Function &NewFunc, AssumptionCache *AC) { for (auto AssumeVH : AC->assumptions()) { - auto *I = dyn_cast_or_null<CondGuardInst>(AssumeVH); + auto *I = dyn_cast_or_null<CallInst>(AssumeVH); if (!I) continue; @@ -1862,7 +1862,7 @@ bool CodeExtractor::verifyAssumptionCache(const Function &OldFunc, // that were previously in the old function, but that have now been moved // to the new function. for (auto AffectedValVH : AC->assumptionsFor(I->getOperand(0))) { - auto *AffectedCI = dyn_cast_or_null<CondGuardInst>(AffectedValVH); + auto *AffectedCI = dyn_cast_or_null<CallInst>(AffectedValVH); if (!AffectedCI) continue; if (AffectedCI->getFunction() != &OldFunc) diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index 5d47236..2061738 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -2333,7 +2333,7 @@ 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<CondGuardInst>(&I)) + if (auto *II = dyn_cast<AssumeInst>(&I)) IFI.GetAssumptionCache(*Caller).registerAssumption(II); } |