Constant fold switch inst when looking for trivial conditions to unswitch on.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Transforms/Scalar/LoopUnswitch.cpp | ||
---|---|---|
922 ↗ | (On Diff #85417) | 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 ↗ | (On Diff #85417) | Yes, this has to be a constant int of abitrary width. |
Comment Actions
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 ↗ | (On Diff #85458) | Can you use SwitchInst::findCaseValue rather than an explicit loop? |