]> granicus.if.org Git - llvm/commit
[SimplifyCFG] delay switch condition forwarding to -latesimplifycfg
authorSanjay Patel <spatel@rotateright.com>
Sun, 22 Oct 2017 19:10:07 +0000 (19:10 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 22 Oct 2017 19:10:07 +0000 (19:10 +0000)
commit5882b22ad1bf57f1d0afce011db5ef161dc44611
tree7761366d4850a1c1ac5ef2dcf79fad96caeb303e
parenta6c26ffedc88be0bd27f3fa9c9876442d5b2c1c5
[SimplifyCFG] delay switch condition forwarding to -latesimplifycfg

As discussed in D39011:
https://reviews.llvm.org/D39011
...replacing constants with a variable is inverting the transform done
by other IR passes, so we definitely don't want to do this early.
In fact, it's questionable whether this transform belongs in SimplifyCFG
at all. I'll look at moving this to codegen as a follow-up step.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316298 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Utils/Local.h
lib/Transforms/Scalar/SimplifyCFGPass.cpp
lib/Transforms/Utils/SimplifyCFG.cpp
test/Transforms/SimplifyCFG/ForwardSwitchConditionToPHI.ll