Constant fold switch inst when looking for trivial conditions to unswitch on.
Details
Diff Detail
- Build Status
Buildable 3204 Build 3204: arc lint + arc unit
Event Timeline
lib/Transforms/Scalar/LoopUnswitch.cpp | ||
---|---|---|
922 | I agree that the constants probably have been folded at this point. The only constants remaining are likely to be the ones generated by unswitching (Even those ones are likely to be folded away by SimplifyCode in LoopUnswitch) or maybe we have some pass ordering problems. I am fine dropping the ConstantFoldInstruction, as this does add some compilation time to the pass. | |
928 | Yes, this has to be a constant int of abitrary width. |
After thinking about it. I decided to drop the constant-folding as they are not trivially cheap.
Especially at this point, they have probably been folded away, the ones remaining probably can
not be folded anyways.
lib/Transforms/Scalar/LoopUnswitch.cpp | ||
---|---|---|
931 | Can you use SwitchInst::findCaseValue rather than an explicit loop? |
Is this likely to actually do anything in practice...? Most passes (including LoopUnswitch itself) will constant-fold newly generated code.