diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2017-10-22 19:10:07 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2017-10-22 19:10:07 +0000 |
| commit | b80daf0b48c6be27812c95904298fac0c9bdc4e2 (patch) | |
| tree | 26cfe1572d9998ca15e55056cc18a3a3cf4dfb98 /llvm/include | |
| parent | dc168722daa842e93c3651057b3dde507a5c1e2d (diff) | |
| download | bcm5719-llvm-b80daf0b48c6be27812c95904298fac0c9bdc4e2.tar.gz bcm5719-llvm-b80daf0b48c6be27812c95904298fac0c9bdc4e2.zip | |
[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
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Transforms/Utils/Local.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/include/llvm/Transforms/Utils/Local.h b/llvm/include/llvm/Transforms/Utils/Local.h index af00a6c2cce..f66a05eb8c0 100644 --- a/llvm/include/llvm/Transforms/Utils/Local.h +++ b/llvm/include/llvm/Transforms/Utils/Local.h @@ -60,14 +60,16 @@ class TargetTransformInfo; /// replaced by lookup tables and selects. struct SimplifyCFGOptions { int BonusInstThreshold; + bool ForwardSwitchCondToPhi; bool ConvertSwitchToLookupTable; bool NeedCanonicalLoop; AssumptionCache *AC; - SimplifyCFGOptions(int BonusThreshold = 1, bool SwitchToLookup = false, - bool CanonicalLoops = true, + SimplifyCFGOptions(int BonusThreshold = 1, bool ForwardSwitchCond = false, + bool SwitchToLookup = false, bool CanonicalLoops = true, AssumptionCache *AssumpCache = nullptr) : BonusInstThreshold(BonusThreshold), + ForwardSwitchCondToPhi(ForwardSwitchCond), ConvertSwitchToLookupTable(SwitchToLookup), NeedCanonicalLoop(CanonicalLoops), AC(AssumpCache) {} }; |

