llvm-project/llvm/test/Analysis/ScalarEvolution
Roman Lebedev c868335e24
[SCEV] ScalarEvolution::createSCEV(): clarify no-wrap flag propagation for shift by bitwidth-1
Summary:
There was this comment here previously:
```
-        // It is currently not resolved how to interpret NSW for left
-        // shift by BitWidth - 1, so we avoid applying flags in that
-        // case. Remove this check (or this comment) once the situation
-        // is resolved. See
-        // http://lists.llvm.org/pipermail/llvm-dev/2015-April/084195.html
-        // and http://reviews.llvm.org/D8890 .
```
But langref was fixed in rL286785, and the behavior is pretty obvious:
http://volta.cs.utah.edu:8080/z/MM4WZP
^ nuw can always be propagated. nsw can be propagated if
either nuw is specified, or the shift is by *less* than bitwidth-1.

This mimics similar D81189 Reassociate change, alive2 is happy about that one.

I'm not sure `NUW` isn't being printed, but that seems unrelated.

Reviewers: mkazantsev, reames, sanjoy, nlopes, craig.topper, efriedma

Reviewed By: efriedma

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81243
2020-06-06 13:02:07 +03:00
..
2007-07-15-NegativeStride.ll
2007-08-06-MisinterpretBranch.ll
2007-08-06-Unsigned.ll
2007-09-27-LargeStepping.ll
2007-11-14-SignedAddRec.ll
2007-11-18-OrInstruction.ll
2008-02-11-ReversedCondition.ll
2008-02-12-SMAXTripCount.ll
2008-02-15-UMax.ll
2008-05-25-NegativeStepToZero.ll
2008-06-12-BinomialInt64.ll
2008-07-12-UnneededSelect1.ll
2008-07-12-UnneededSelect2.ll
2008-07-19-InfiniteLoop.ll
2008-07-19-WrappingIV.ll
2008-07-29-SGTTripCount.ll
2008-07-29-SMinExpr.ll [SCEV] Add explicit representations of umin/smin 2019-05-07 15:28:47 +00:00
2008-08-04-IVOverflow.ll
2008-08-04-LongAddRec.ll
2008-11-02-QuadraticCrash.ll
2008-11-15-CubicOOM.ll
2008-11-18-LessThanOrEqual.ll
2008-11-18-Stride1.ll
2008-11-18-Stride2.ll
2008-12-08-FiniteSGE.ll
2008-12-11-SMaxOverflow.ll
2008-12-14-StrideAndSigned.ll
2008-12-15-DontUseSDiv.ll
2009-01-02-SignedNegativeStride.ll
2009-04-22-TruncCast.ll
2009-05-09-PointerEdgeCount.ll
2009-07-04-GroupConstantsWidthMismatch.ll
2010-09-03-RequiredTransitive.ll
2011-03-09-ExactNoMaxBECount.ll
2011-04-26-FoldAddRec.ll
2011-10-04-ConstEvolve.ll
2012-03-26-LoadConstant.ll
2012-05-18-LoopPredRecurse.ll
2012-05-29-MulAddRec.ll Require "target datalayout" to be at the beginning of an IR file. 2020-04-20 11:55:49 -07:00
SolveQuadraticEquation.ll
ZeroStep.ll
add-like-or.ll [NFC][SCEV] Add test with 'or' with no common bits set 2020-06-05 12:18:15 +03:00
and-xor.ll [SCEV] Simplify zext/trunc idiom that appears when handling bitmasks. 2018-06-14 17:13:48 +00:00
avoid-assume-hang.ll
avoid-infinite-recursion-0.ll
avoid-infinite-recursion-1.ll
avoid-smax-0.ll
avoid-smax-1.ll Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1) 2018-01-19 17:13:12 +00:00
binomial-explision.ll [SCEV] Avoid redundant computations when doing AddRec merge 2018-11-01 06:18:27 +00:00
cache_loop_exit_limit.ll
constant_condition.ll
depth-limit-overrun.ll [SCEV] Constant fold MultExpr before applying depth limit. 2020-05-22 18:34:32 +03:00
different-loops-recs.ll Re-apply "[SCEV] Strengthen StrengthenNoWrapFlags (reapply r334428)." 2018-07-13 23:58:46 +00:00
div-overflow.ll
do-loop.ll
exact-exit-count-more-precise.ll [SCEV] Handle case where MaxBECount is less precise than ExactBECount for OR. 2019-03-02 02:31:44 +00:00
exact_iter_count.ll Re-enable "[SCEV] Make computeExitLimit more simple and more powerful" 2018-05-03 02:37:55 +00:00
exhaustive-trip-counts.ll
expander-replace-congruent-ivs.ll
exponential-behavior.ll
ext-antecedent.ll
extract-highbits-sameconstmask.ll [SCEV] Use unsigned/signed intersection type in SCEV 2019-06-15 09:15:52 +00:00
extract-highbits-variablemask.ll [NFC][SCEV] Add tests related to bit masking (PR37793) 2018-06-20 07:54:11 +00:00
extract-lowbits-sameconstmask.ll [NFC][SCEV] Add tests related to bit masking (PR37793) 2018-06-20 07:54:11 +00:00
extract-lowbits-variablemask.ll [NFC][SCEV] Add tests related to bit masking (PR37793) 2018-06-20 07:54:11 +00:00
flags-from-poison-dbg.ll [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
flags-from-poison.ll [SCEV] ScalarEvolution::createSCEV(): clarify no-wrap flag propagation for shift by bitwidth-1 2020-06-06 13:02:07 +03:00
flattened-0.ll
fold.ll Fix incorrect CHECK-LABEL 2018-06-11 19:56:12 +00:00
guards.ll [SimplifyIndVars] Ignore dead users 2018-06-13 02:25:32 +00:00
how-far-to-zero.ll
huge_expression_limit.ll [SCEV] Prohibit SCEV transformations for huge SCEVs 2019-01-31 06:19:25 +00:00
implied-via-addition.ll
implied-via-division.ll
incorrect-nsw.ll
increasing-or-decreasing-iv.ll [SCEV] Use unsigned/signed intersection type in SCEV 2019-06-15 09:15:52 +00:00
infer-prestart-no-wrap.ll [SCEV] Use unsigned/signed intersection type in SCEV 2019-06-15 09:15:52 +00:00
infer-via-ranges.ll
inner-loop-by-latch-cond-unknown.ll [SCEV] Re-land: Fix isKnownPredicate 2018-03-19 06:35:30 +00:00
invalidation.ll
latch-dominating-conditions.ll
limit-depth.ll [SCEV] Constant fold MultExpr before applying depth limit. 2020-05-22 18:34:32 +03:00
load-with-range-metadata.ll
load.ll
lshr-shl-differentconstmask.ll [SCEV] Use unsigned/signed intersection type in SCEV 2019-06-15 09:15:52 +00:00
max-addops-inline.ll
max-addrec-size.ll
max-be-count-not-constant.ll [SCEV] Fix an assertion failure in the max backedge taken count 2017-10-25 21:41:00 +00:00
max-expr-cache.ll [SCEV] Add smin support to getRangeRef 2019-09-12 21:32:27 +00:00
max-mulops-inline.ll
max-trip-count-address-space.ll [SCEV] Simplify umin/max of zext and sext of the same value 2019-10-19 17:23:02 +00:00
max-trip-count.ll [SCEV] Simplify umin/max of zext and sext of the same value 2019-10-19 17:23:02 +00:00
merge-add-rec-many-inputs.ll Fix overconfident assert in ScalarEvolution::isImpliedViaMerge 2018-06-29 11:46:30 +00:00
min-max-exprs.ll [SCEV] Add explicit representations of umin/smin 2019-05-07 15:28:47 +00:00
multiple-max-iterations.ll [Analysis] Allow -scalar-evolution-max-iterations more than once 2019-09-19 18:21:32 +00:00
no-wrap-add-exprs.ll Infer alignment of unmarked loads in IR/bitcode parsing. 2020-05-14 13:03:50 -07:00
no-wrap-unknown-becount.ll
non-IV-phi.ll
nowrap-preinc-limits.ll
nsw-offset-assume.ll Re-apply "[SCEV] Strengthen StrengthenNoWrapFlags (reapply r334428)." 2018-07-13 23:58:46 +00:00
nsw-offset.ll Re-apply "[SCEV] Strengthen StrengthenNoWrapFlags (reapply r334428)." 2018-07-13 23:58:46 +00:00
nsw.ll [ValueTracking] Let propagatesPoison support binops/unaryops/cast/etc. 2020-05-13 02:51:42 +09:00
nw-sub-is-not-nw-add.ll
overflow-intrinsics-trip-count.ll [SCEV] teach SCEV symbolical execution about overflow intrinsics folding. 2019-07-11 02:18:22 +00:00
overflow-intrinsics.ll
pointer-sign-bits.ll
pr3909.ll
pr18606-min-zeros.ll Fixed typos in tests: s/CEHCK/CHECK/ 2019-02-25 13:12:33 +00:00
pr18606.ll Fixed typos in tests: s/CEHCK/CHECK/ 2019-02-25 13:12:33 +00:00
pr22179.ll
pr22641.ll
pr22674.ll Migrate function attribute "no-frame-pointer-elim"="false" to "frame-pointer"="none" as cleanups after D56351 2019-12-24 16:27:51 -08:00
pr22856.ll
pr24757.ll
pr25369.ll
pr27315.ll
pr34538.ll [SCEV] Handling for ICmp occuring in the evolution chain. 2017-11-13 16:43:24 +00:00
pr35890.ll [SCEV] Make getPostIncExpr guaranteed to return AddRec 2018-02-12 05:09:38 +00:00
pr40420.ll [SCEV] Take correct loop in AddRec simplification. PR40420 2019-01-29 05:37:59 +00:00
pr44605.ll [SCEV] Use backedge SCEV of PHI only if its input is loop invariant 2020-03-31 18:39:24 +07:00
predicated-trip-count.ll [SCEV] Add explicit representations of umin/smin 2019-05-07 15:28:47 +00:00
range-signedness.ll
range_nw_flag.ll [SCEV] accurate range for addrecexpr with nuw flag 2020-01-12 20:22:37 -05:00
returned.ll
scalable-vector.ll [SCEV] Add support for GEPs over scalable vectors. 2020-03-13 16:12:45 -07:00
scev-aa.ll
scev-canonical-mode.ll Migrate function attribute "no-frame-pointer-elim"="false" to "frame-pointer"="none" as cleanups after D56351 2019-12-24 16:27:51 -08:00
scev-dispositions.ll
scev-expander-existing-value-offset.ll
scev-expander-incorrect-nowrap.ll
scev-expander-reuse-gep.ll
scev-expander-reuse-unroll.ll [LoopUnroll] Add support for loops with exiting headers and uncond latches. 2019-06-26 09:16:57 +00:00
scev-expander-reuse-vect.ll
scev-invalid.ll
scev-prestart-nowrap.ll
sext-inreg.ll [SCEV] Simplify trunc-of-add/mul to add/mul-of-trunc under more circumstances. 2018-06-14 17:13:35 +00:00
sext-iv-0.ll
sext-iv-1.ll
sext-iv-2.ll
sext-mul.ll [SCEV] Simplify umin/max of zext and sext of the same value 2019-10-19 17:23:02 +00:00
sext-to-zext.ll
sext-zero.ll Revert "[SCEV] Add nuw/nsw to mul ops in StrengthenNoWrapFlags" 2018-06-19 04:09:44 +00:00
shift-op.ll [SCEV] Fix predicate usage in computeExitLimitFromICmp 2017-12-08 12:19:45 +00:00
shl-lshr-differentconstmask.ll Re-apply "[SCEV] Strengthen StrengthenNoWrapFlags (reapply r334428)." 2018-07-13 23:58:46 +00:00
sle.ll
smax-br-phi-idioms.ll
smax.ll
solve-quadratic-i1.ll [SCEV] Properly solve quadratic equations 2018-08-02 19:13:35 +00:00
solve-quadratic-overflow.ll [SCEV] Properly solve quadratic equations 2018-08-02 19:13:35 +00:00
solve-quadratic.ll [test] Fix ScalarEvolution test to allow __func__ with prototype 2018-12-02 16:49:28 +00:00
strip-injective-zext.ll [SCEV] Simplify trunc-of-add/mul to add/mul-of-trunc under more circumstances. 2018-06-14 17:13:35 +00:00
trip-count-andor.ll [SCEV] Add a mode to skip classification when printing analysis 2019-11-21 10:24:19 -08:00
trip-count-pow2.ll Re-apply "[SCEV] Strengthen StrengthenNoWrapFlags (reapply r334428)." 2018-07-13 23:58:46 +00:00
trip-count-switch.ll
trip-count-unknown-stride.ll
trip-count.ll [Tests] Autogenerate a bunch of SCEV trip count tests for readability. Will likely merge some of these files soon. 2019-11-21 10:46:16 -08:00
trip-count2.ll [Tests] Autogenerate a bunch of SCEV trip count tests for readability. Will likely merge some of these files soon. 2019-11-21 10:46:16 -08:00
trip-count3.ll [Tests] Autogenerate a bunch of SCEV trip count tests for readability. Will likely merge some of these files soon. 2019-11-21 10:46:16 -08:00
trip-count4.ll [Tests] Autogenerate a bunch of SCEV trip count tests for readability. Will likely merge some of these files soon. 2019-11-21 10:46:16 -08:00
trip-count5.ll
trip-count6.ll [Tests] Autogenerate a bunch of SCEV trip count tests for readability. Will likely merge some of these files soon. 2019-11-21 10:46:16 -08:00
trip-count7.ll [Tests] Autogenerate a bunch of SCEV trip count tests for readability. Will likely merge some of these files soon. 2019-11-21 10:46:16 -08:00
trip-count8.ll [Tests] Autogenerate a bunch of SCEV trip count tests for readability. Will likely merge some of these files soon. 2019-11-21 10:46:16 -08:00
trip-count9.ll [Tests] Autogenerate a bunch of SCEV trip count tests for readability. Will likely merge some of these files soon. 2019-11-21 10:46:16 -08:00
trip-count10.ll [Tests] Autogenerate a bunch of SCEV trip count tests for readability. Will likely merge some of these files soon. 2019-11-21 10:46:16 -08:00
trip-count11.ll
trip-count12.ll Revert "[SCEV] add no wrap flag for SCEVAddExpr." 2019-09-30 07:46:52 +00:00
trip-count13.ll
trip-count14.ll Update -analyze -scalar-evolution output for multiple exit loops w/computable exit values 2019-06-27 19:22:43 +00:00
trip-count15.ll [SCEV] Add smin support to getRangeRef 2019-09-12 21:32:27 +00:00
tripmultiple_calculation.ll
trunc-simplify.ll [SCEV] Simplify trunc-of-add/mul to add/mul-of-trunc under more circumstances. 2018-06-14 17:13:35 +00:00
truncate.ll [SCEV] Fix buggy behavior in getAddExpr with truncs 2018-07-19 01:46:21 +00:00
umin-umax-folds.ll [SCEV] Simplify umin/max of zext and sext of the same value 2019-10-19 17:23:02 +00:00
undefined.ll
unknown_phis.ll [SCEV] Smart range calculation for SCEVUnknown Phis 2018-03-01 06:56:48 +00:00
unreachable-code.ll [SCEV] Do not bother creating separate SCEVUnknown for unreachable nodes 2019-02-04 05:04:19 +00:00
unsimplified-loop.ll
urem-0.ll
widenable-condition.ll [Tests] Add a SCEV analysis test for llvm.widenable.condition 2019-10-14 22:42:35 +00:00
zext-divrem.ll [SCEV] Re-apply r335197 (with Polly fixes). 2018-06-21 21:29:54 +00:00
zext-mul.ll Re-apply "[SCEV] Strengthen StrengthenNoWrapFlags (reapply r334428)." 2018-07-13 23:58:46 +00:00
zext-signed-addrec.ll
zext-wrap.ll