llvm-project/llvm/test/Transforms/InstSimplify/ConstProp
Nikita Popov c117d77e93 [ConstantFold] Refactor load folding
This refactors load folding to happen in two cleanly separated
steps: ConstantFoldLoadFromConstPtr() takes a pointer to load from
and decomposes it into a constant initializer base and an offset.
Then ConstantFoldLoadFromConst() loads from that initializer at
the given offset. This makes the core logic independent of having
actual GEP expressions (and those GEP expressions having certain
structure) and will allow exposing ConstantFoldLoadFromConst() as
an independent API in the future.

This is mostly only a refactoring, but it does make the folding
logic slightly more powerful.

Differential Revision: https://reviews.llvm.org/D111023
2021-10-05 18:07:57 +02:00
..
AArch64 [AArch64] Constant fold sve_convert_from_svbool(zero) to zero 2021-04-20 10:02:49 +00:00
AMDGPU [AMDGPU] Constant fold Intrinsic::amdgcn_perm 2021-05-10 16:23:11 -07:00
ARM
WebAssembly [WebAssembly] Remove saturating fp-to-int target intrinsics 2021-04-16 12:11:20 -07:00
2002-03-11-ConstPropCrash.ll
2002-05-03-DivideByZeroException.ll
2002-05-03-NotOperator.ll
2002-09-03-SetCC-Bools.ll
2003-05-12-DivideError.ll
2005-01-28-SetCCGEP.ll
2006-11-30-vector-cast.ll
2006-12-01-TruncBoolBug.ll
2006-12-01-bool-casts.ll
2007-02-05-BitCast.ll
2007-02-23-sdiv.ll
2008-07-07-VectorCompare.ll
2009-06-20-constexpr-zero-lhs.ll
2009-09-01-GEP-Crash.ll
InsertElement-inseltpoison.ll Reapply [ConstantFold] Fold more operations to poison 2021-05-13 16:04:12 +02:00
InsertElement.ll Reapply [ConstantFold] Fold more operations to poison 2021-05-13 16:04:12 +02:00
abs.ll
active-lane-mask.ll [ConstProp] Constant propagation for get.active.lane.mask instrinsics 2021-01-08 16:10:01 +00:00
allones.ll
avx512.ll
basictest.ll
binop-identity-undef.ll
bitcast.ll
bitcount.ll
bswap.ll
calls-math-finite.ll [Tests] Add willreturn to libcalls in some tests 2021-01-22 21:47:35 +01:00
calls.ll [Tests] Add willreturn to libcalls in some tests 2021-01-22 21:47:35 +01:00
cast-vector.ll
cast.ll Reapply [ConstantFold] Fold more operations to poison 2021-05-13 16:04:12 +02:00
constant-expr.ll
convert-from-fp16.ll
copysign.ll [ConstantFolding] Enable folding of min/max/copysign for all floats 2021-06-10 11:57:51 +07:00
div-zero.ll
extractelement-vscale.ll [InstSimplify] Add constant fold for extractelement + splat for scalable vectors 2021-06-10 12:41:40 +01:00
extractvalue.ll
float-to-ptr-cast.ll
fma.ll
fneg.ll
fp-undef.ll
freeze.ll
funnel-shift.ll
gep-alias-gep-load.ll [ConstFold] Simplify a load's GEP operand through local aliases 2021-05-27 16:04:19 -07:00
gep-alias.ll
gep-constanfolding-error.ll
gep-zeroinit-vector.ll
gep.ll
icmp-null.ll [ConstantFold] Handle icmp of global and null consistently 2021-03-08 17:18:01 +01:00
insertvalue.ll
libfunc.ll [ConstantFolding] avoid crashing on a fake math library call 2021-07-20 18:25:21 -04:00
loads.ll [ConstantFold] Refactor load folding 2021-10-05 18:07:57 +02:00
logicaltest.ll
math-1.ll [InstSimplify] Add willreturn to more libcall tests (NFC) 2021-01-22 21:58:59 +01:00
math-2.ll Update @llvm.powi to handle different int sizes for the exponent 2021-06-17 09:38:28 +02:00
min-max.ll [ConstantFolding] Enable folding of min/max/copysign for all floats 2021-06-10 11:57:51 +07:00
overflow-ops.ll [ConstantFolding] Fixing addo/subo with undef 2021-03-31 21:47:29 +03:00
phi.ll
poison.ll [InstSimplify] Add more poison folding optimizations 2021-06-23 20:25:24 +09:00
remtest.ll
rint.ll [Local] Treat calls that may not return as being alive. 2021-01-23 16:05:14 +00:00
round.ll [Tests] Add willreturn to libcalls in some tests 2021-01-22 21:47:35 +01:00
saturating-add-sub.ll
shift.ll Reapply [ConstantFold] Fold more operations to poison 2021-05-13 16:04:12 +02:00
smul-fix-sat.ll [ConstantFold] Handle undef/poison when constant folding smul_fix/smul_fix_sat 2021-03-12 09:09:58 +01:00
smul-fix.ll [ConstantFold] Handle undef/poison when constant folding smul_fix/smul_fix_sat 2021-03-12 09:09:58 +01:00
sse.ll
timeout.ll
trunc.ll [Tests] Add willreturn to libcalls in some tests 2021-01-22 21:47:35 +01:00
trunc_vec.ll
vecreduce.ll [IR] Handle constant expressions in containsUndefinedElement() 2021-09-09 22:04:12 +02:00
vector-undef-elts-inseltpoison.ll Reapply [ConstantFold] Fold more operations to poison 2021-05-13 16:04:12 +02:00
vector-undef-elts.ll Reapply [ConstantFold] Fold more operations to poison 2021-05-13 16:04:12 +02:00
vectorgep-crash.ll
vscale-getelementptr.ll
vscale-inseltpoison.ll [IR] Let ConstantVector::getSplat use poison instead of undef 2021-08-10 08:27:43 +01:00
vscale-shufflevector-inseltpoison.ll
vscale-shufflevector.ll
vscale.ll [IR] Let ConstantVector::getSplat use poison instead of undef 2021-08-10 08:27:43 +01:00