llvm-project/llvm/test/Transforms/IndVarSimplify/X86
Roman Lebedev d57e9aca01
[IndVarSimplify] Don't replace IV user with unsafe loop-invariant (PR45360)
Summary:
As [[ https://bugs.llvm.org/show_bug.cgi?id=45360 | PR45360 ]] reports,
with new cost-model we can sometimes end up being able to expand `udiv`/`urem` instructions.
And that exposes at least one instance of when we do that
regardless of whether or not it is safe to do.
In this particular case, it's `SimplifyIndvar::replaceIVUserWithLoopInvariant()`.

It seems to me, we simply need to check with `isSafeToExpandAt()` first.

The test isn't great. I'm not sure how to make it only run `-indvars`.

Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=45360 | PR45360 ]].

Reviewers: mkazantsev, reames, helloqirun

Reviewed By: mkazantsev

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82108
2020-06-23 13:53:15 +03:00
..
2009-04-14-shorten_iv_vars.ll
2009-04-15-shorten-iv-vars-2.ll
2011-11-15-multiexit.ll
deterministic-scev-verify.ll
eliminate-trunc.ll
huge_muls.ll
indvar-debug-value.ll
indvar-debug-value2.ll
inner-loop-by-latch-cond.ll
inner-loop.ll
iv-widen.ll
lit.local.cfg
loop-invariant-conditions.ll
loop_evaluate10.ll
overflow-intrinsics.ll
polynomial-expand.ll
pr24356.ll
pr24804.ll
pr24956.ll
pr25047.ll
pr25051.ll
pr25360.ll
pr25421.ll
pr25576.ll
pr26973.ll
pr27133.ll
pr28935.ll
pr35406.ll
pr45360.ll [IndVarSimplify] Don't replace IV user with unsafe loop-invariant (PR45360) 2020-06-23 13:53:15 +03:00
replace-iv-with-loop-invariant.ll
scev-phi-debug-info.ll
uglygep.ll
variable-stride-ivs-1.ll
verify-scev.ll
widen-nsw.ll