Instruction has mayHaveSideEffects method that returns true if mayThrow return true because this is called internally in the first method
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | ||
---|---|---|
1670 | Or better, implement TODO? |
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | ||
---|---|---|
1669 | Maybe we should have some scanlimit for huge BBs? |
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | ||
---|---|---|
1670 | 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?