llvm-project/llvm/test
Kazu Hirata e23d786526 [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
..
Analysis [X86] Attempt to more accurately model the cost of a bool reduction of wide vector type. 2020-03-19 09:31:05 -07:00
Assembler
Bindings
Bitcode
BugPoint
CodeGen [AMDGPU] Move frame pointer from s34 to s33 2020-03-19 15:35:16 -04:00
DebugInfo [AMDGPU] Add Scratch Wave Offset to Scratch Buffer Descriptor in entry functions 2020-03-19 15:35:16 -04:00
Demangle
Examples
ExecutionEngine
Feature
FileCheck
IR
Instrumentation
Integer
JitListener
LTO
Linker
MC [MC] Recalculate fragment offsets after relaxation 2020-03-17 14:48:05 -07:00
MachineVerifier
Object [obj2yaml] - SHT_DYNAMIC and SHT_REL* sections: stop dumping sh_entsize field when it has the default value. 2020-03-19 17:25:53 +03:00
ObjectYAML
Other
Reduce
SafepointIRVerifier
Support
SymbolRewriter
TableGen
ThinLTO/X86
Transforms [JumpThreading] Fix infinite loop (PR44611) 2020-03-19 12:49:36 -07:00
Unit
Verifier [VP,Integer,#1] Vector-predicated integer intrinsics 2020-03-19 10:51:47 +01:00
YAMLParser
tools [test] Re-enable accidentally disabled X86 tests 2020-03-19 09:29:23 -07:00
.clang-format
CMakeLists.txt
TestRunner.sh
lit.cfg.py
lit.site.cfg.py.in