From 4c2d29f2fc78782a469ccff625dd29d66d4d9f9b Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Fri, 28 Apr 2023 15:37:32 +0100 Subject: [PATCH] [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 --- llvm/lib/Analysis/ScalarEvolution.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 9429b2f11a582..641bf7b7f8d17 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -8385,6 +8385,8 @@ void ScalarEvolution::visitAndClearUsers( SmallVectorImpl &ToForget) { while (!Worklist.empty()) { Instruction *I = Worklist.pop_back_val(); + if (!isSCEVable(I->getType())) + continue; ValueExprMapType::iterator It = ValueExprMap.find_as(static_cast(I));