OSDN Git Service

[SimplifyCFG] avoid sinking insts within an infinite-loop
authorSanjay Patel <spatel@rotateright.com>
Fri, 12 Mar 2021 12:56:54 +0000 (07:56 -0500)
committerTom Stellard <tstellar@redhat.com>
Mon, 29 Mar 2021 19:09:57 +0000 (12:09 -0700)
commite94372d1b395a6461e7d973917b3a3c29563a5e6
treefcc2ad6028c3067d6fdfe66d0a2477fe3d0ceb8b
parentf4c01f33f450f654a63363b4eb84bf744c24959c
[SimplifyCFG] avoid sinking insts within an infinite-loop

The test is reduced from a C source example in:
https://llvm.org/PR49541

It's possible that the test could be reduced further or
the predicate generalized further, but it seems to require
a few ingredients (including the "late" SimplifyCFG options
on the RUN line) to fall into the infinite-loop trap.

(cherry picked from commit bd197ed0a57a82187ed3c6265ca811d412acfaef)
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/sink-inf-loop.ll [new file with mode: 0644]