llvm-mirror/test/Transforms/SCCP
Florian Hahn 932ea47fda [SCCP] Turn sext into zext for non-negative ranges.
This patch updates SCCP/IPSCCP to use the computed range info to turn
sexts into zexts, if the value is known to be non-negative. We already
to a similar transform in CorrelatedValuePropagation, but it seems like
we can catch a lot of additional cases by doing it in SCCP/IPSCCP as
well.

The transform is limited to ranges that are known to not include undef.

Currently constant ranges from conditions are treated as potentially
containing undef, due to PR46144. Once we flip this, the transform will
be more effective in practice.

Reviewers: efriedma, davide

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D81756
2020-06-19 10:17:55 +01:00
..
2002-05-02-MissSecondInst.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2002-05-20-MissedIncomingValue.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2002-05-21-InvalidSimplify.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2002-08-30-GetElementPtrTest.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2003-06-24-OverdefinedPHIValue.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2003-08-26-InvokeHandling.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2004-11-16-DeadInvoke.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2004-12-10-UndefBranchBug.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2006-10-23-IPSCCP-Crash.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2006-12-04-PackedType.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2006-12-19-UndefBug.ll Recommit "[SCCP] Remove forcedconstant, go to overdefined instead" 2020-02-15 18:36:44 +01:00
2007-05-16-InvokeCrash.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2008-01-27-UndefCorrelate.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2008-04-22-multiple-ret-sccp.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2008-05-23-UndefCallFold.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2009-01-14-IPSCCP-Invoke.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
2009-05-27-VectorOperandZero.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
apfloat-basictest.ll [SCCP] Add UnaryOperator visitor to SCCP for unary FNeg 2019-06-03 21:53:56 +00:00
apint-array.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
apint-basictest2.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
apint-basictest3.ll [NFC] Fix trivial typos in comments 2020-01-06 10:50:26 +00:00
apint-basictest4.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
apint-basictest.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
apint-bigarray.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
apint-bigint2.ll [SCCP] Do not mark unknown loads as overdefined. 2020-02-20 22:48:58 +01:00
apint-bigint.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
apint-ipsccp1.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
apint-ipsccp2.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
apint-ipsccp3.ll Recommit "[SCCP] Remove forcedconstant, go to overdefined instead" 2020-02-15 18:36:44 +01:00
apint-ipsccp4.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
apint-load.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
apint-phi.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
apint-select.ll Recommit "[SCCP] Remove forcedconstant, go to overdefined instead" 2020-02-15 18:36:44 +01:00
apint-xor.ll [SCCP] Add a few more tests for conditional propagation,XOR. 2020-03-22 21:43:33 +00:00
atomic-load-store.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
atomic.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
binaryops-constexprs.ll [SCCP] Add test case for binary ops with constant expressions. 2020-04-09 13:38:43 +01:00
binaryops-range-special-cases.ll [SCCP] Use constant ranges for PHI nodes. 2020-03-19 12:45:33 +00:00
bitcast.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
calltest.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
comdat-ipo.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
conditions-iter-order.ll [SCCP] Add a few more tests for conditional propagation,XOR. 2020-03-22 21:43:33 +00:00
conditions-ranges-with-undef.ll [SCCP] Use ranges for predicate info conditions. 2020-04-07 11:09:18 +01:00
conditions-ranges.ll Infer alignment of unmarked loads in IR/bitcode parsing. 2020-05-14 13:03:50 -07:00
constant-range-struct.ll [SCCP] Switch to widen at PHIs, stores and call edges. 2020-05-29 11:59:17 +01:00
constant-struct.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
crash.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
definite-initializer.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
dont-zap-return.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
float-nan-simplification.ll Recommit "[SCCP] Use SimplifyBinOp for non-integer constant/expressions & overdef." 2020-04-14 11:48:52 +01:00
float-phis.ll [ValueLattice] Add new state for undef constants. 2020-03-14 17:19:59 +00:00
global-alias-constprop.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
indirectbr.ll [IPSCCP] Move callsite check to the beginning of the loop. 2019-07-31 12:57:04 +00:00
int-phis.ll [ValueLattice] Add new state for undef constants. 2020-03-14 17:19:59 +00:00
ip-constant-ranges.ll [SCCP] Use ranges for predicate info conditions. 2020-04-07 11:09:18 +01:00
ip-ranges-binaryops.ll [SCCP] Use constant ranges for binary operators. 2020-03-19 09:35:48 +00:00
ip-ranges-casts.ll [SCCP] Turn sext into zext for non-negative ranges. 2020-06-19 10:17:55 +01:00
ip-ranges-phis.ll [SCCP] Use constant ranges for PHI nodes. 2020-03-19 12:45:33 +00:00
ip-ranges-select.ll [SCCP] Use constant ranges for select, if cond is overdefined. 2020-03-18 09:26:02 +00:00
ip-ranges-sext.ll [SCCP] Turn sext into zext for non-negative ranges. 2020-06-19 10:17:55 +01:00
ipsccp-addr-taken.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
ipsccp-basic.ll Recommit "[SCCP] Remove forcedconstant, go to overdefined instead" 2020-02-15 18:36:44 +01:00
ipsccp-branch-unresolved-undef.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
ipsccp-cycles.ll [SCCP] Switch to widen at PHIs, stores and call edges. 2020-05-29 11:59:17 +01:00
ipsccp-phi-one-pred-dead.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
ipsccp-predinfo-order.ll [PredicateInfo] Replace pointer comparisons with deterministic compares. 2019-07-25 20:48:13 +00:00
ipsccp-preserve-analysis.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
ipsccp-range-crashes.ll [SCCP] Precommit some additional tests for integer ranges. 2020-03-18 11:34:04 +00:00
ipsccp-ssa-copy-nested-conds.ll [SCCP] Add tests with AND/OR branch conditions. 2020-04-09 16:39:13 +01:00
latticeval-invalidate.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
load-store-range.ll [SCCP] Support ranges for loads and stores. 2020-04-26 13:16:47 +01:00
loadtest2.ll [SCCP] Do not mark unknown loads as overdefined. 2020-02-20 22:48:58 +01:00
loadtest.ll [SCCP] Do not mark unknown loads as overdefined. 2020-02-20 22:48:58 +01:00
logical-nuke.ll Recommit "[SCCP] Remove forcedconstant, go to overdefined instead" 2020-02-15 18:36:44 +01:00
overdefined-div.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
phi-cycle.ll [ValueLattice] Distinguish between constant ranges with/without undef. 2020-03-31 12:50:20 +01:00
phis.ll [SCCP] Use constant ranges for PHI nodes. 2020-03-19 12:45:33 +00:00
pr27712.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr35357.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
pr45185-range-predinfo.ll Recommit "[SCCP] Use ValueLatticeElement instead of LatticeVal (NFCI)" 2020-03-13 17:03:22 +00:00
preserve-analysis.ll [BPI][NFC] Reuse post dominantor tree from analysis manager when available 2020-04-30 11:31:03 +07:00
range-and-ip.ll [ValueLattice] Distinguish between constant ranges with/without undef. 2020-03-31 12:50:20 +01:00
range-and.ll [ValueLattice] Distinguish between constant ranges with/without undef. 2020-03-31 12:50:20 +01:00
ranges-sext.ll [SCCP] Turn sext into zext for non-negative ranges. 2020-06-19 10:17:55 +01:00
resolvedundefsin-tracked-fn.ll [SCCP] Switch to widen at PHIs, stores and call edges. 2020-05-29 11:59:17 +01:00
return-zapped.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
retvalue-undef.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
sccptest.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
select.ll [SCCP] Use constant ranges for select, if cond is overdefined. 2020-03-18 09:26:02 +00:00
struct-arg-resolve-undefs.ll [IPSCCP] Move callsite check to the beginning of the loop. 2019-07-31 12:57:04 +00:00
switch-constantfold-crash.ll [SCCP] Fix crash when trying to constant-fold terminators multiple times. 2019-05-08 09:09:54 +00:00
switch-multiple-undef.ll Recommit "[SCCP] Remove forcedconstant, go to overdefined instead" 2020-02-15 18:36:44 +01:00
switch-undef-constantfoldterminator.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
switch.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
ub-shift.ll Recommit "[SCCP] Use SimplifyBinOp for non-integer constant/expressions & overdef." 2020-04-14 11:48:52 +01:00
ubsan_overflow.ll [SCCP] Update condition to avoid overflow. 2019-07-31 18:22:22 +00:00
undef-resolve.ll Recommit "[SCCP] Remove forcedconstant, go to overdefined instead" 2020-02-15 18:36:44 +01:00
vector-bitcast.ll Recommit "[SCCP] Use SimplifyBinOp for non-integer constant/expressions & overdef." 2020-04-14 11:48:52 +01:00
widening.ll [SCCP] Turn sext into zext for non-negative ranges. 2020-06-19 10:17:55 +01:00