[PATCH] D48238: [SCEV] Simplify some flags expressions.
Justin Lebar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 15 16:56:47 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL334875: [SCEV] Simplify some flags expressions. (authored by jlebar, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D48238?vs=151555&id=151587#toc
Repository:
rL LLVM
https://reviews.llvm.org/D48238
Files:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Index: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
===================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp
@@ -3897,7 +3897,7 @@
auto AddFlags = SCEV::FlagAnyWrap;
const bool RHSIsNotMinSigned =
!getSignedRangeMin(RHS).isMinSignedValue();
- if ((Flags & SCEV::FlagNSW) == SCEV::FlagNSW) {
+ if (Flags & SCEV::FlagNSW) {
// Let M be the minimum representable signed value. Then (-1)*RHS
// signed-wraps if and only if RHS is M. That can happen even for
// a NSW subtraction because e.g. (-1)*M signed-wraps even though
@@ -11940,7 +11940,7 @@
SCEV::NoWrapFlags ScevFlags = AR->getNoWrapFlags();
IncrementWrapFlags IFlags = Flags;
- if ((ScevFlags | SCEV::FlagNSW) == ScevFlags)
+ if (ScevFlags & SCEV::FlagNSW)
IFlags &= ~IncrementNSSW;
return IFlags == IncrementAnyWrap;
@@ -11962,10 +11962,10 @@
SCEV::NoWrapFlags StaticFlags = AR->getNoWrapFlags();
// We can safely transfer the NSW flag as NSSW.
- if ((StaticFlags | SCEV::FlagNSW) == StaticFlags)
+ if (StaticFlags & SCEV::FlagNSW)
ImpliedFlags = IncrementNSSW;
- if ((StaticFlags | SCEV::FlagNUW) == StaticFlags) {
+ if (StaticFlags & SCEV::FlagNUW) {
// If the increment is positive, the SCEV NUW flag will also imply the
// WrapPredicate NUSW flag.
if (const auto *Step = dyn_cast<SCEVConstant>(AR->getStepRecurrence(SE)))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48238.151587.patch
Type: text/x-patch
Size: 1472 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180615/e2b0ec64/attachment.bin>
More information about the llvm-commits
mailing list