Instruction has mayHaveSideEffects method that returns true if mayThrow return true because this is called internally in the first method
Details
Diff Detail
Event Timeline
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | ||
---|---|---|
1673 | Or better, implement TODO? |
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | ||
---|---|---|
1672 | Maybe we should have some scanlimit for huge BBs? |
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | ||
---|---|---|
1673 | Ideally we should be using SCEV loop properties here, which are cached. Unfortunately, the SCEV notion of "side effect" differs from what is needed here (SCEV ignores simple writes). We could at least use loopHasNoAbnormalExits() though, which uses isGuaranteedToTransfer(). And I do believe that one is needed here -- I don't think the transform is valid if the loop contains a non-willreturn readonly call. It would be good to add a test for that case. |
LGTM.
(I'm ignoring the side discussion as it doesn't appear to relate to the patch which is simply a small cleanup.)
Maybe we should have some scanlimit for huge BBs?