llvm-project/llvm/test/Transforms/SCCP
Eli Friedman 4532a50899 Infer alignment of unmarked loads in IR/bitcode parsing.
For IR generated by a compiler, this is really simple: you just take the
datalayout from the beginning of the file, and apply it to all the IR
later in the file. For optimization testcases that don't care about the
datalayout, this is also really simple: we just use the default
datalayout.

The complexity here comes from the fact that some LLVM tools allow
overriding the datalayout: some tools have an explicit flag for this,
some tools will infer a datalayout based on the code generation target.
Supporting this properly required plumbing through a bunch of new
machinery: we want to allow overriding the datalayout after the
datalayout is parsed from the file, but before we use any information
from it. Therefore, IR/bitcode parsing now has a callback to allow tools
to compute the datalayout at the appropriate time.

Not sure if I covered all the LLVM tools that want to use the callback.
(clang? lli? Misc IR manipulation tools like llvm-link?). But this is at
least enough for all the LLVM regression tests, and IR without a
datalayout is not something frontends should generate.

This change had some sort of weird effects for certain CodeGen
regression tests: if the datalayout is overridden with a datalayout with
a different program or stack address space, we now parse IR based on the
overridden datalayout, instead of the one written in the file (or the
default one, if none is specified). This broke a few AVR tests, and one
AMDGPU test.

Outside the CodeGen tests I mentioned, the test changes are all just
fixing CHECK lines and moving around datalayout lines in weird places.

Differential Revision: https://reviews.llvm.org/D78403
2020-05-14 13:03:50 -07:00
..
2002-05-02-MissSecondInst.ll
2002-05-20-MissedIncomingValue.ll
2002-05-21-InvalidSimplify.ll
2002-08-30-GetElementPtrTest.ll
2003-06-24-OverdefinedPHIValue.ll
2003-08-26-InvokeHandling.ll
2004-11-16-DeadInvoke.ll
2004-12-10-UndefBranchBug.ll
2006-10-23-IPSCCP-Crash.ll
2006-12-04-PackedType.ll
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
2008-01-27-UndefCorrelate.ll
2008-04-22-multiple-ret-sccp.ll
2008-05-23-UndefCallFold.ll
2009-01-14-IPSCCP-Invoke.ll
2009-05-27-VectorOperandZero.ll
apfloat-basictest.ll
apint-array.ll
apint-basictest.ll
apint-basictest2.ll
apint-basictest3.ll
apint-basictest4.ll
apint-bigarray.ll
apint-bigint.ll
apint-bigint2.ll [SCCP] Do not mark unknown loads as overdefined. 2020-02-20 22:48:58 +01:00
apint-ipsccp1.ll
apint-ipsccp2.ll
apint-ipsccp3.ll Recommit "[SCCP] Remove forcedconstant, go to overdefined instead" 2020-02-15 18:36:44 +01:00
apint-ipsccp4.ll
apint-load.ll
apint-phi.ll
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
atomic.ll
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
calltest.ll
comdat-ipo.ll
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] Drop unnecessary early exit for ExtractValueInst. 2020-04-22 22:07:59 +01:00
constant-struct.ll
crash.ll
definite-initializer.ll
dont-zap-return.ll
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
indirectbr.ll
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] Limit use of range info for binops to integers for now. 2020-03-31 17:08:09 +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
ipsccp-addr-taken.ll
ipsccp-basic.ll Recommit "[SCCP] Remove forcedconstant, go to overdefined instead" 2020-02-15 18:36:44 +01:00
ipsccp-branch-unresolved-undef.ll
ipsccp-phi-one-pred-dead.ll
ipsccp-predinfo-order.ll
ipsccp-preserve-analysis.ll
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
load-store-range.ll [SCCP] Support ranges for loads and stores. 2020-04-26 13:16:47 +01:00
loadtest.ll [SCCP] Do not mark unknown loads as overdefined. 2020-02-20 22:48:58 +01:00
loadtest2.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
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
pr35357.ll
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
resolvedundefsin-tracked-fn.ll Recommit "[SCCP] Use ValueLatticeElement instead of LatticeVal (NFCI)" 2020-03-13 17:03:22 +00:00
return-zapped.ll
retvalue-undef.ll
sccptest.ll
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
switch-constantfold-crash.ll
switch-multiple-undef.ll Recommit "[SCCP] Remove forcedconstant, go to overdefined instead" 2020-02-15 18:36:44 +01:00
switch-undef-constantfoldterminator.ll
switch.ll
ub-shift.ll Recommit "[SCCP] Use SimplifyBinOp for non-integer constant/expressions & overdef." 2020-04-14 11:48:52 +01:00
ubsan_overflow.ll
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 [ValueLattice] Merging unknown with empty CR is unknown. 2020-04-25 13:43:34 +01:00