1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/Transforms/JumpThreading
Kazu Hirata 0f5d7d1ae5 [JumpThreading] Fix infinite loop (PR44611)
Summary:
This patch fixes https://bugs.llvm.org/show_bug.cgi?id=44611 by
preventing an infinite loop in the jump threading pass when
-jump-threading-across-loop-headers is on.  Specifically, without this
patch, jump threading through two basic blocks would trigger on the
same area of the CFG over and over, resulting in an infinite loop.

Consider testcase PR44611-across-header-hang.ll in this patch.  The
first opportunity to thread through two basic blocks is:

  from bb_body2 through bb_header and bb_body1 to bb_body2.

The pass duplicates bb_header and bb_body1 as, say, bb_header.thread1
and bb_body1.thread1.  Since bb_header contains a successor edge back
to itself, bb_header.thread1 also contains a successor edge to
bb_header, immediately giving rise to the next jump threading
opportunity:

  from bb_header.thread1 through bb_header and bb_body1 to bb_body2.

After that, we repeatedly thread an incoming edge into bb_header
through bb_header and bb_body1 to bb_body2.  In other words, we keep
peeling one iteration from bb_header's self loop.

The patch fixes the problem by preventing the pass from duplicating a
basic block containing a self loop.

Reviewers: wmi, junparser, efriedma

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76390
2020-03-19 12:49: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
and-and-cond.ll
and-cond.ll
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 [JumpThreading] Half the duplicate threshold at Oz 2020-02-03 08:40:20 +00:00
combine-metadata.ll Temporarily revert "Reapply [LVI] Normalize pointer behavior" and "[LVI] Restructure caching" 2019-12-20 10:25:57 -08:00
compare.ll
conservative-lvi.ll
crash.ll
ddt-crash2.ll
ddt-crash3.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
ddt-crash4.ll
ddt-crash.ll
degenerate-phi.ll
fold-not-thread.ll
guards.ll
header-succ.ll
implied-cond.ll
indirectbr.ll
induction.ll
landing-pad.ll
loop-phi.ll
lvi-load.ll
lvi-tristate.ll
ne-undef.ll [ValueLattice] Add new state for undef constants. 2020-03-14 17:19:59 +00:00
no-irreducible-loops.ll
or-undef.ll
phi-eq.ll
phi-known.ll
pr9331.ll
pr15851_hang.ll
pr22086.ll
pr26096.ll
pr27840.ll
pr33605.ll [llvm] Fix broken cases of 'CHECK[^:]*$' in tests 2020-01-28 09:52:59 -07:00
pr33917.ll
pr36133.ll
pr40992-indirectbr-folding.ll
PR33357-lvi-recursion.ll
PR37745.ll
PR44611-across-header-hang.ll [JumpThreading] Fix infinite loop (PR44611) 2020-03-19 12:49:36 -07:00
range-compare.ll
redundant-dbg-info.ll Reapply "[DebugInfo] Prevent explosion of debug intrinsics during jump threading" 2020-02-12 12:39:54 +00:00
removed-use.ll
select.ll [JumpThreading] add a miscompile test based on discussion in D76332; NFC 2020-03-18 16:46:18 -04:00
stale-loop-info-after-unfold-select.ll
static-profile.ll
thread-cmp.ll
thread-loads.ll
thread-two-bbs1.ll Resubmit^2: [JumpThreading] Thread jumps through two basic blocks 2020-02-05 09:23:37 -08:00
thread-two-bbs2.ll Resubmit^2: [JumpThreading] Thread jumps through two basic blocks 2020-02-05 09:23:37 -08:00
thread-two-bbs3.ll Resubmit^2: [JumpThreading] Thread jumps through two basic blocks 2020-02-05 09:23:37 -08:00
thread-two-bbs4.ll Resubmit^2: [JumpThreading] Thread jumps through two basic blocks 2020-02-05 09:23:37 -08:00
thread-two-bbs5.ll Resubmit^2: [JumpThreading] Thread jumps through two basic blocks 2020-02-05 09:23:37 -08:00
thread-two-bbs6.ll [JumpThreading] Skip unconditional PredBB when threading jumps through two basic blocks 2020-02-18 11:01:46 -08:00
threading_prof1.ll
threading_prof2.ll
unreachable-loops.ll
update-edge-weight.ll [JumpThreading] Use profile data even with the new pass manager 2019-11-22 08:21:48 -08:00