[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)
commitb80daf0b48c6be27812c95904298fac0c9bdc4e2
tree26cfe1572d9998ca15e55056cc18a3a3cf4dfb98
parentdc168722daa842e93c3651057b3dde507a5c1e2d
[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.

llvm-svn: 316298
llvm/include/llvm/Transforms/Utils/Local.h
llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/ForwardSwitchConditionToPHI.ll