[llvm] 4c2d29f - [SCEV] Skip instrs with non-scevable types in visitAndClearUsers.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 28 07:37:50 PDT 2023


Author: Florian Hahn
Date: 2023-04-28T15:37:35+01:00
New Revision: 4c2d29f2fc78782a469ccff625dd29d66d4d9f9b

URL: https://github.com/llvm/llvm-project/commit/4c2d29f2fc78782a469ccff625dd29d66d4d9f9b
DIFF: https://github.com/llvm/llvm-project/commit/4c2d29f2fc78782a469ccff625dd29d66d4d9f9b.diff

LOG: [SCEV] Skip instrs with non-scevable types in visitAndClearUsers.

No SCEVs are formed for instructions with non-scevable types, so no
other SCEV expressions can depend on them. Skip those instructions and
their users when invalidating SCEV expressions.

Depends on D144847.

Reviewed By: mkazantsev

Differential Revision: https://reviews.llvm.org/D144848

Added: 
    

Modified: 
    llvm/lib/Analysis/ScalarEvolution.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 9429b2f11a58..641bf7b7f8d1 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -8385,6 +8385,8 @@ void ScalarEvolution::visitAndClearUsers(
     SmallVectorImpl<const SCEV *> &ToForget) {
   while (!Worklist.empty()) {
     Instruction *I = Worklist.pop_back_val();
+    if (!isSCEVable(I->getType()))
+      continue;
 
     ValueExprMapType::iterator It =
         ValueExprMap.find_as(static_cast<Value *>(I));


        


More information about the llvm-commits mailing list