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/Analysis/AssumptionCache.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'llvm/lib/Analysis/AssumptionCache.cpp') diff --git a/llvm/lib/Analysis/AssumptionCache.cpp b/llvm/lib/Analysis/AssumptionCache.cpp index 2d648cc..11796ef 100644 --- a/llvm/lib/Analysis/AssumptionCache.cpp +++ b/llvm/lib/Analysis/AssumptionCache.cpp @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// // -// This file contains a pass that keeps track of @llvm.assume and -// @llvm.experimental.guard intrinsics in the functions of a module. +// This file contains a pass that keeps track of @llvm.assume intrinsics in +// the functions of a module. // //===----------------------------------------------------------------------===// @@ -140,7 +140,7 @@ findAffectedValues(CallBase *CI, TargetTransformInfo *TTI, } } -void AssumptionCache::updateAffectedValues(CondGuardInst *CI) { +void AssumptionCache::updateAffectedValues(AssumeInst *CI) { SmallVector Affected; findAffectedValues(CI, TTI, Affected); @@ -153,7 +153,7 @@ void AssumptionCache::updateAffectedValues(CondGuardInst *CI) { } } -void AssumptionCache::unregisterAssumption(CondGuardInst *CI) { +void AssumptionCache::unregisterAssumption(AssumeInst *CI) { SmallVector Affected; findAffectedValues(CI, TTI, Affected); @@ -217,7 +217,7 @@ void AssumptionCache::scanFunction() { // to this cache. for (BasicBlock &B : F) for (Instruction &I : B) - if (isa(&I)) + if (isa(&I)) AssumeHandles.push_back({&I, ExprResultIdx}); // Mark the scan as complete. @@ -225,10 +225,10 @@ void AssumptionCache::scanFunction() { // Update affected values. for (auto &A : AssumeHandles) - updateAffectedValues(cast(A)); + updateAffectedValues(cast(A)); } -void AssumptionCache::registerAssumption(CondGuardInst *CI) { +void AssumptionCache::registerAssumption(AssumeInst *CI) { // If we haven't scanned the function yet, just drop this assumption. It will // be found when we scan later. if (!Scanned) @@ -238,9 +238,9 @@ void AssumptionCache::registerAssumption(CondGuardInst *CI) { #ifndef NDEBUG assert(CI->getParent() && - "Cannot a register CondGuardInst not in a basic block"); + "Cannot register @llvm.assume call not in a basic block"); assert(&F == CI->getParent()->getParent() && - "Cannot a register CondGuardInst not in this function"); + "Cannot register @llvm.assume call not in this function"); // We expect the number of assumptions to be small, so in an asserts build // check that we don't accumulate duplicates and that all assumptions point @@ -252,8 +252,8 @@ void AssumptionCache::registerAssumption(CondGuardInst *CI) { assert(&F == cast(VH)->getParent()->getParent() && "Cached assumption not inside this function!"); - assert(isa(VH) && - "Cached something other than CondGuardInst!"); + assert(match(cast(VH), m_Intrinsic()) && + "Cached something other than a call to @llvm.assume!"); assert(AssumptionSet.insert(VH).second && "Cache contains multiple copies of a call!"); } -- cgit v1.1