OSDN Git Service

Disable jump threading into loop headers
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Wed, 6 Sep 2017 19:36:58 +0000 (19:36 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Wed, 6 Sep 2017 19:36:58 +0000 (19:36 +0000)
commit9ca441aa442dd8c33b7a580447ede231b8f02ea7
tree8946557cb2b1a8ac563e234a85500601496e88a7
parent64aa32b606ec20bc3d732b48b6da5935069a1aa5
Disable jump threading into loop headers

Consider this type of a loop:
    for (...) {
      ...
      if (...) continue;
      ...
    }
Normally, the "continue" would branch to the loop control code that
checks whether the loop should continue iterating and which contains
the (often) unique loop latch branch. In certain cases jump threading
can "thread" the inner branch directly to the loop header, creating
a second loop latch. Loop canonicalization would then transform this
loop into a loop nest. The problem with this is that in such a loop
nest neither loop is countable even if the original loop was. This
may inhibit subsequent loop optimizations and be detrimental to
performance.

Differential Revision: https://reviews.llvm.org/D36404

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312664 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/JumpThreading.cpp
test/Transforms/JumpThreading/static-profile.ll