[PATCH] D104702: [LSR] Filter out zero factors. PR50765
Max Kazantsev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 22 21:14:15 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb7d2c173ebbb: [LSR] Filter out zero factors. PR50765 (authored by mkazantsev).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104702/new/
https://reviews.llvm.org/D104702
Files:
llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
llvm/test/Transforms/LoopStrengthReduce/pr50765.ll
Index: llvm/test/Transforms/LoopStrengthReduce/pr50765.ll
===================================================================
--- llvm/test/Transforms/LoopStrengthReduce/pr50765.ll
+++ llvm/test/Transforms/LoopStrengthReduce/pr50765.ll
@@ -1,6 +1,4 @@
; RUN: opt -S -loop-reduce < %s | FileCheck %s
-; XFAIL: *
-; REQUIRES: asserts
;
;This test produces zero factor that becomes a denumerator and fails an assetion.
Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -2712,13 +2712,13 @@
if (const SCEVConstant *Factor =
dyn_cast_or_null<SCEVConstant>(getExactSDiv(NewStride, OldStride,
SE, true))) {
- if (Factor->getAPInt().getMinSignedBits() <= 64)
+ if (Factor->getAPInt().getMinSignedBits() <= 64 && !Factor->isZero())
Factors.insert(Factor->getAPInt().getSExtValue());
} else if (const SCEVConstant *Factor =
dyn_cast_or_null<SCEVConstant>(getExactSDiv(OldStride,
NewStride,
SE, true))) {
- if (Factor->getAPInt().getMinSignedBits() <= 64)
+ if (Factor->getAPInt().getMinSignedBits() <= 64 && !Factor->isZero())
Factors.insert(Factor->getAPInt().getSExtValue());
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104702.353846.patch
Type: text/x-patch
Size: 1557 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210623/f57e053a/attachment.bin>
More information about the llvm-commits
mailing list