From 0cbb8ec030e23c0e13331b5d54155def8c901b36 Mon Sep 17 00:00:00 2001 From: Max Kazantsev Date: Mon, 20 Feb 2023 18:38:07 +0700 Subject: 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 --- llvm/lib/Transforms/Utils/CodeExtractor.cpp | 14 +++++++------- llvm/lib/Transforms/Utils/InlineFunction.cpp | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'llvm/lib/Transforms/Utils') 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(&I)) { + if (auto *AI = dyn_cast(&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(AssumeVH); + auto *I = dyn_cast_or_null(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(AffectedValVH); + auto *AffectedCI = dyn_cast_or_null(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(&I)) + if (auto *II = dyn_cast(&I)) IFI.GetAssumptionCache(*Caller).registerAssumption(II); } -- cgit v1.1