1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/test/Transforms/SimplifyCFG
Nikita Popov 730509657a [InstCombine] DCE instructions earlier
When InstCombine initially populates the worklist, it already
performs constant folding and DCE. However, as the instructions
are initially visited in program order, this DCE can pick up only
the last instruction of a dead chain, the rest would only get
picked up in the main InstCombine run.

To avoid this, we instead perform the DCE in separate pass over the
collected instructions in reverse order, which will allow us to
pick up full dead instruction chains. We already need to do this
reverse iteration anyway to populate the worklist, so this
shouldn't add extra cost.

This by itself only fixes a small part of the problem though:
The same basic issue also applies during the main InstCombine loop.
We generally always want DCE to occur as early as possible,
because it will allow one-use folds to happen. Address this by also
performing DCE while adding deferred instructions to the main worklist.

This drops the number of tests that perform more than 2 InstCombine
iterations from ~80 to ~40. There's some spurious test changes due
to operand order / icmp toggling.

Differential Revision: https://reviews.llvm.org/D75008
2020-02-27 18:45:59 +01:00
..
AArch64
AMDGPU
ARM
Hexagon
Mips
PowerPC
RISCV
SPARC
X86
2002-05-21-PHIElimination.ll
2002-09-24-PHIAssertion.ll
2003-03-07-DominateProblem.ll
2003-08-05-InvokeCrash.ll
2003-08-17-BranchFold.ll
2003-08-17-BranchFoldOrdering.ll
2003-08-17-FoldSwitch-dbg.ll
2003-08-17-FoldSwitch.ll
2004-12-10-SimplifyCFGCrash.ll
2005-06-16-PHICrash.ll
2005-08-01-PHIUpdateFail.ll
2005-10-02-InvokeSimplify.ll
2005-12-03-IncorrectPHIFold.ll
2006-02-17-InfiniteUnroll.ll
2006-06-12-InfLoop.ll
2006-08-03-Crash.ll
2006-10-19-UncondDiv.ll
2006-12-08-Ptr-ICmp-Branch.ll
2007-11-22-InvokeNoUnwind.ll
2007-12-21-Crash.ll
2008-01-02-hoist-fp-add.ll
2008-05-16-PHIBlockMerge.ll
2008-07-13-InfLoopMiscompile.ll
2008-09-08-MultiplePred.ll
2008-09-17-SpeculativeHoist.ll
2008-10-03-SpeculativelyExecuteBeforePHI.ll
2008-12-06-SingleEntryPhi.ll
2008-12-16-DCECond.ll
2009-01-18-PHIPropCrash.ll
2009-05-12-externweak.ll
2010-03-30-InvokeCrash.ll
2011-03-08-UnreachableUse.ll
2011-09-05-TrivialLPad.ll
assume.ll
attr-convergent.ll
attr-noduplicate.ll
basictest.ll
bbi-23595.ll
branch-cond-merge.ll
branch-cond-prop.ll
branch-fold-dbg.ll
branch-fold-test.ll
branch-fold-three.ll
branch-fold-threshold.ll
branch-fold.ll
branch-phi-thread.ll
BrUnwind.ll
bug-25299.ll
clamp.ll
combine-parallel-mem-md.ll
common-dest-folding.ll
ConditionalTrappingConstantExpr.ll
CoveredLookupTable.ll
critedge-assume.ll
dbginfo.ll
dce-cond-after-folding-terminator.ll
DeadSetCC.ll
debug-info-thread-phi.ll
div-rem-pairs.ll
duplicate-landingpad.ll
duplicate-phis.ll
empty-catchpad.ll
empty-cleanuppad.ll [WinEH] Ignore lifetime.end PHI nodes in empty cleanuppads 2020-01-23 18:18:50 -08:00
EmptyBlockMerge.ll
EqualPHIEdgeBlockMerge.ll
extract-cost.ll
fold-branch-debuginvariant.ll
fold-debug-info.ll
ForwardSwitchConditionToPHI.ll
gepcost.ll
guards.ll
hoist-common-code.ll
hoist-dbgvalue-inlined.ll
hoist-dbgvalue.ll
hoist-with-range.ll
HoistCode.ll
implied-and-or.ll
implied-cond-matching-false-dest.ll
implied-cond-matching-imm.ll
implied-cond-matching.ll
implied-cond.ll
indirectbr.ll
InfLoop.ll
inline-asm-sink.ll
invalidate-dom.ll
invoke_unwind.ll
invoke.ll
iterative-simplify.ll
lifetime.ll
MagicPointer.ll
merge-cleanuppads.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
merge-cond-stores-2.ll
merge-cond-stores.ll [InstCombine] DCE instructions earlier 2020-02-27 18:45:59 +01:00
multiple-phis.ll
no_speculative_loads_with_asan.ll
no_speculative_loads_with_tsan.ll
no-md-sink.ll
noreturn-call.ll
opt-for-fuzzing.ll
phi-undef-loadstore.ll
PhiBlockMerge2.ll
PhiBlockMerge.ll
PhiEliminate2.ll
PhiEliminate3.ll
PhiEliminate.ll
PHINode.ll
PhiNoEliminate.ll
pr33605.ll
pr34131.ll
pr35774.ll
pr39807.ll
PR9946.ll
PR16069.ll
PR17073.ll
PR25267.ll
PR27615-simplify-cond-br.ll
PR29163.ll
PR30210.ll
preserve-branchweights-partial.ll
preserve-branchweights-switch-create.ll
preserve-branchweights.ll
preserve-llvm-loop-metadata.ll
preserve-load-metadata-2.ll
preserve-load-metadata-3.ll
preserve-load-metadata.ll
preserve-make-implicit-on-switch-to-br.ll
preserve-store-alignment.ll
rangereduce.ll
remove-debug-2.ll
remove-debug.ll
return-merge.ll
safe-abs.ll
safe-low-bit-extract.ll
seh-nounwind.ll
select-gep.ll
signbit-like-value-extension.ll
sink-common-code.ll
speculate-call.ll
speculate-dbgvalue.ll
speculate-math.ll
speculate-store.ll
speculate-vector-ops.ll
speculate-with-offset.ll
SpeculativeExec.ll
statepoint-invoke-unwind.ll
suppress-zero-branch-weights.ll
switch_create-custom-dl.ll
switch_create.ll
switch_msan.ll
switch_switch_fold.ll
switch_thread.ll
switch_undef.ll
switch-dead-default.ll
switch-masked-bits.ll
switch-on-const-select.ll
switch-profmd.ll
switch-range-to-icmp.ll
switch-simplify-crash.ll
switch-to-br.ll
switch-to-icmp.ll
switch-to-select-multiple-edge-per-block-phi.ll
switch-to-select-two-case.ll
trap-debugloc.ll
trap-no-null-opt-debugloc.ll
trapping-load-unreachable.ll
two-entry-phi-return.ll
UncondBranchToHeader.ll
UncondBranchToReturn.ll
unreachable_assume.ll
unreachable-blocks.ll
unreachable-cleanuppad.ll
UnreachableEliminate.ll
unsigned-multiplication-will-overflow.ll
volatile-phioper.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
wc-widen-block.ll
wineh-unreachable.ll