[SCEV] Skip instrs with non-scevable types in visitAndClearUsers.
authorFlorian Hahn <flo@fhahn.com>
Fri, 28 Apr 2023 14:37:32 +0000 (15:37 +0100)
committerFlorian Hahn <flo@fhahn.com>
Fri, 28 Apr 2023 14:37:35 +0000 (15:37 +0100)
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

llvm/lib/Analysis/ScalarEvolution.cpp

index 9429b2f..641bf7b 100644 (file)
@@ -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));