llvm-project/llvm/test/Transforms/SimplifyCFG/X86
Roman Lebedev cc63203908
[SimplifyCFG] Common code sinking: fix application of profitability check
The profitability check is: we don't want to create more than a single PHI
per instruction sunk. We need to create the PHI unless we'll sink
all of it's would-be incoming values.

But there is a caveat there.
This profitability check doesn't converge on the first iteration!
If we first decide that we want to sink 10 instructions,
but then determine that 5'th one is unprofitable to sink,
that may result in us not sinking some instructions that
resulted in determining that some other instruction
we've determined to be profitable to sink becoming unprofitable.

So we need to iterate until we converge, as in determine
that all leftover instructions are profitable to sink.

But, the direct approach of just re-iterating seems dumb,
because in the worst case we'd find that the last instruction
is unprofitable, which would result in revisiting instructions
many many times.

Instead, i think we can get away with just two passes - forward and backward.
However then it isn't obvious what is the most performant way to update
InstructionsToSink.
2021-04-29 21:11:40 +03:00
..
2010-03-30-InvokeCrash.ll [SimplifyCFG] Teach simplifySingleResume() to preserve DomTree 2020-12-20 00:18:34 +03:00
CoveredLookupTable.ll [SimplifyCFG] Teach SwitchToLookupTable() to preserve DomTree 2020-12-30 23:58:41 +03:00
MagicPointer.ll [SimplifyCFG] Teach FoldValueComparisonIntoPredecessors() to preserve DomTree, part 1 2021-01-01 03:25:22 +03:00
PR29163.ll [SimplifyCFG] Teach FoldTwoEntryPHINode() to preserve DomTree 2020-12-20 00:18:33 +03:00
PR30210.ll [SimplifyCFG] Teach simplifyUnreachable() to preserve DomTree 2020-12-18 00:37:22 +03:00
SpeculativeExec.ll [tests] Refresh a bunch of autogen test to adjust for format changes 2021-03-22 10:41:39 -07:00
bug-25299.ll [SimplifyCFG] Teach simplifyCommonResume() to preserve DomTree 2020-12-20 00:18:34 +03:00
combine-parallel-mem-md.ll [NFCI][SimplifyCFG] Mark all the SimplifyCFG tests that already don't invalidate DomTree as such 2020-12-17 01:03:49 +03:00
critedge-assume.ll [SimplifyCFG] Teach FoldCondBranchOnPHI() to preserve DomTree 2020-12-30 00:48:11 +03:00
disable-lookup-table.ll [NFC][SimplifyCFG] Autogenerate check lines in many test files 2021-04-27 22:05:42 +03:00
empty-cleanuppad.ll [NFC][SimplifyCFG] Autogenerate check lines in many test files 2021-04-27 22:05:42 +03:00
invalidate-dom.ll [NewPM][opt] Run the "default" AA pipeline by default 2021-01-21 21:08:54 -08:00
lit.local.cfg
merge-cleanuppads.ll [SimplifyCFG] MergeBlockIntoPredecessor() already knows how to preserve DomTree 2020-12-17 01:03:49 +03:00
merge-cond-stores-cost.ll [NFC][SimplifyCFG] Autogenerate check lines in many test files 2021-04-27 22:05:42 +03:00
pr39187-g.ll [SimplifyCFG] Teach HoistThenElseCodeToIf() to preserve DomTree 2020-12-30 00:48:10 +03:00
remove-debug-2.ll [SimplifyCFG] TryToSimplifyUncondBranchFromEmptyBlock() already knows how to preserve DomTree 2020-12-17 01:03:49 +03:00
remove-debug.ll [SimplifyCFG] TryToSimplifyUncondBranchFromEmptyBlock() already knows how to preserve DomTree 2020-12-17 01:03:49 +03:00
safe-low-bit-extract.ll [SimplifyCFG] Teach FoldTwoEntryPHINode() to preserve DomTree 2020-12-20 00:18:33 +03:00
sink-common-code.ll [SimplifyCFG] Common code sinking: fix application of profitability check 2021-04-29 21:11:40 +03:00
speculate-cttz-ctlz.ll [SimplifyCFG] Teach FoldTwoEntryPHINode() to preserve DomTree 2020-12-20 00:18:33 +03:00
switch-covered-bug.ll [SimplifyCFG] Teach SwitchToLookupTable() to preserve DomTree 2020-12-30 23:58:41 +03:00
switch-table-bug.ll [SimplifyCFG] Teach SwitchToLookupTable() to preserve DomTree 2020-12-30 23:58:41 +03:00
switch_to_lookup_table.ll
unreachable-blocks.ll [SimplifyCFG] MergeBlockIntoPredecessor() already knows how to preserve DomTree 2020-12-17 01:03:49 +03:00