llvm-project/llvm/test/Transforms/JumpThreading
Evgeniy Brevnov 9fb074e7bb [BPI] Improve static heuristics for "cold" paths.
Current approach doesn't work well in cases when multiple paths are predicted to be "cold". By "cold" paths I mean those containing "unreachable" instruction, call marked with 'cold' attribute and 'unwind' handler of 'invoke' instruction. The issue is that heuristics are applied one by one until the first match and essentially ignores relative hotness/coldness
 of other paths.

New approach unifies processing of "cold" paths by assigning predefined absolute weight to each block estimated to be "cold". Then we propagate these weights up/down IR similarly to existing approach. And finally set up edge probabilities based on estimated block weights.

One important difference is how we propagate weight up. Existing approach propagates the same weight to all blocks that are post-dominated by a block with some "known" weight. This is useless at least because it always gives 50\50 distribution which is assumed by default anyway. Worse, it causes the algorithm to skip further heuristics and can miss setting more accurate probability. New algorithm propagates the weight up only to the blocks that dominates and post-dominated by a block with some "known" weight. In other words, those blocks that are either always executed or not executed together.

In addition new approach processes loops in an uniform way as well. Essentially loop exit edges are estimated as "cold" paths relative to back edges and should be considered uniformly with other coldness/hotness markers.

Reviewed By: yrouban

Differential Revision: https://reviews.llvm.org/D79485
2020-12-23 22:47:36 +07:00
..
2008-11-27-EntryMunge.ll
2010-08-26-and.ll
2011-04-02-SimplifyDeadBlock.ll
2011-04-14-InfLoop.ll
2012-07-19-NoSuccessorIndirectBr.ll
PR33357-lvi-recursion.ll
PR37745.ll
PR44611-across-header-hang.ll
and-and-cond.ll [NFCI][SimplifyCFG] Mark all the SimplifyCFG tests that already don't invalidate DomTree as such 2020-12-17 01:03:49 +03:00
and-cond.ll [NFCI][SimplifyCFG] Mark all the SimplifyCFG tests that already don't invalidate DomTree as such 2020-12-17 01:03:49 +03:00
assume-edge-dom.ll
assume.ll
basic.ll
bb-unreachable-from-entry.ll
branch-debug-info.ll
branch-no-const.ll
callbr-edge-split.ll
codesize-loop.ll
combine-metadata.ll
compare.ll
conservative-lvi.ll
constant-fold-status.ll [JumpThreading] Fix an incorrect Modified status 2020-09-14 10:36:13 +02:00
crash.ll
ddt-crash.ll
ddt-crash2.ll OpaquePtr: Bulk update tests to use typed sret 2020-11-20 17:58:26 -05:00
ddt-crash3.ll
ddt-crash4.ll
degenerate-phi.ll
divergent-target-test.ll Disable Jump Threading for the targets with divergent control flow 2020-12-17 02:40:54 +03:00
fold-not-thread.ll
freeze-lvi-edgevaluelocal.ll [LazyValueInfo] Let getEdgeValueLocal look into freeze instructions 2020-08-11 16:39:34 +09:00
freeze.ll [JumpThreading] Update test freeze.ll; NFC 2020-08-04 20:27:54 +09:00
guards.ll
header-succ.ll
implied-cond.ll
indirectbr.ll
induction.ll
is_constant.ll
landing-pad.ll
loop-phi.ll Revert "[InstSimplify][EarlyCSE] Try to CSE PHI nodes in the same basic block" 2020-08-28 23:43:42 +00:00
lvi-load.ll
lvi-tristate.ll [SimplifyCFG] DeleteDeadBlock() already knows how to preserve DomTree 2020-12-18 00:37:21 +03:00
ne-undef.ll
no-irreducible-loops.ll [SimplifyCFG] MergeBlockIntoPredecessor() already knows how to preserve DomTree 2020-12-17 01:03:49 +03:00
or-undef.ll
phi-copy-to-pred.ll [JumpThreading] Allow duplicating a basic block into preds when its branch condition is freeze(phi) 2020-08-06 09:51:17 +09:00
phi-eq.ll
phi-known.ll
pr9331.ll
pr15851_hang.ll
pr22086.ll
pr26096.ll [PruneEH] Pin tests to legacy PM 2020-10-29 18:17:55 -07:00
pr27840.ll
pr33605.ll
pr33917.ll
pr36133.ll
pr40992-indirectbr-folding.ll
pr46857-callbr.ll [JumpThreading] ProcessBranchOnXOR(): bailout if any pred ends in indirect branch (PR46857) 2020-07-27 15:39:03 +03:00
pre-load.ll [JumpThreading] Let SimplifyPartiallyRedundantLoad look into freeze 2020-07-31 15:28:24 +09:00
range-compare.ll
redundant-dbg-info.ll
removed-use.ll
select-unfold-freeze.ll [JumpThreading] Conditionally freeze its condition when unfolding select 2020-09-10 15:49:40 +09:00
select-unfold-msan.ll
select.ll
stale-loop-info-after-unfold-select.ll
static-profile.ll
thread-cmp.ll
thread-loads.ll
thread-prob-1.ll [testing] Add missing REQUIRES: asserts 2020-10-28 06:14:54 -04:00
thread-prob-2.ll [JumpThreading] Call eraseBlock when folding a conditional branch 2020-11-15 22:29:30 -08:00
thread-prob-3.ll [BPI] Improve static heuristics for "cold" paths. 2020-12-23 22:47:36 +07:00
thread-prob-4.ll [JumpThreading] Call eraseBlock when folding a conditional branch 2020-12-03 23:50:17 -08:00
thread-prob-5.ll [JumpThreading] Call eraseBlock when folding a conditional branch 2020-12-03 23:50:17 -08:00
thread-prob-6.ll [JumpThreading] Call eraseBlock when folding a conditional branch 2020-12-03 23:50:17 -08:00
thread-two-bbs-cuda.ll [JumpThreading] Merge/rename thread-two-bbsN.ll tests; NFC 2020-08-04 17:07:28 +09:00
thread-two-bbs-msvc.ll [JumpThreading] Merge/rename thread-two-bbsN.ll tests; NFC 2020-08-04 17:07:28 +09:00
thread-two-bbs-threshold.ll [JumpThreading] Consider freeze as a zero-cost instruction 2020-08-05 14:42:36 +09:00
thread-two-bbs.ll [JumpThreading] Merge/rename thread-two-bbsN.ll tests; NFC 2020-08-04 17:07:28 +09:00
threadable-edge-cast.ll [JumpThreading] Remove cast's constraint 2020-08-04 19:09:25 +09:00
threading_prof1.ll Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
threading_prof2.ll Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
unreachable-loops.ll [JumpThreading][VectorUtils] avoid infinite loop on unreachable IR 2020-12-02 13:39:33 -05:00
update-edge-weight.ll Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00