diff options
author | Philip Reames <preames@rivosinc.com> | 2023-05-11 10:55:15 -0700 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2023-05-11 11:16:04 -0700 |
commit | 7fbfcc653f372aed37f81ec0ca4bb2b0ee90a9f4 (patch) | |
tree | cf06c3ad0f6231f030cca852903ddfaae8f11381 /llvm/lib/Analysis/LoopAccessAnalysis.cpp | |
parent | dcac99373207da576821c26792e90a178785f88e (diff) | |
download | llvm-7fbfcc653f372aed37f81ec0ca4bb2b0ee90a9f4.zip llvm-7fbfcc653f372aed37f81ec0ca4bb2b0ee90a9f4.tar.gz llvm-7fbfcc653f372aed37f81ec0ca4bb2b0ee90a9f4.tar.bz2 |
[LV/LAA] Use PSE to identify stride multiplies which simplify [mostly nfc]
LV/LAA will speculate that (some) strided access patterns have unit stride, and insert runtime checks if required.
LV cost models a multiply by such a stride as free. We did this by keeping around the StrideSet structure, just to check if one of the operands were one of the strides we speculated.
We can instead just ask PredicatedScalarEvolution if either of the operands are one (after predicates are applied). We get mostly the same result - PSE can prove it in more cases in theory - and simpler code.
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopAccessAnalysis.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp index df21679..358f97f 100644 --- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp +++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp @@ -2758,7 +2758,6 @@ void LoopAccessInfo::collectStridedAccess(Value *MemAccess) { // SCEVUnknown as we expect. Value *StrideVal = stripIntegerCast(Stride); SymbolicStrides[Ptr] = cast<SCEVUnknown>(PSE->getSCEV(StrideVal)); - StrideSet.insert(Stride); } LoopAccessInfo::LoopAccessInfo(Loop *L, ScalarEvolution *SE, |