[llvm] 0437f88 - [LAA] Cleanup casting in replaceSymbolicStrideSCEV [nfc]
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 6 09:14:03 PDT 2023
Author: Philip Reames
Date: 2023-04-06T09:13:55-07:00
New Revision: 0437f88b77f67fa11d335b0664d857cf315c8e97
URL: https://github.com/llvm/llvm-project/commit/0437f88b77f67fa11d335b0664d857cf315c8e97
DIFF: https://github.com/llvm/llvm-project/commit/0437f88b77f67fa11d335b0664d857cf315c8e97.diff
LOG: [LAA] Cleanup casting in replaceSymbolicStrideSCEV [nfc]
Added:
Modified:
llvm/lib/Analysis/LoopAccessAnalysis.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index 261fa4b10401..623cd22e3295 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -163,11 +163,11 @@ const SCEV *llvm::replaceSymbolicStrideSCEV(PredicatedScalarEvolution &PSE,
Value *StrideVal = stripIntegerCast(SI->second);
ScalarEvolution *SE = PSE.getSE();
- const auto *U = cast<SCEVUnknown>(SE->getSCEV(StrideVal));
- const auto *CT =
- static_cast<const SCEVConstant *>(SE->getOne(StrideVal->getType()));
+ const SCEV *StrideSCEV = SE->getSCEV(StrideVal);
+ assert(isa<SCEVUnknown>(StrideSCEV) && "shouldn't be in map");
- PSE.addPredicate(*SE->getEqualPredicate(U, CT));
+ const auto *CT = SE->getOne(StrideSCEV->getType());
+ PSE.addPredicate(*SE->getEqualPredicate(StrideSCEV, CT));
auto *Expr = PSE.getSCEV(Ptr);
LLVM_DEBUG(dbgs() << "LAA: Replacing SCEV: " << *OrigSCEV
More information about the llvm-commits
mailing list