llvm-project/llvm/test/Transforms/LoopReroll
Eli Friedman 8f3d16905d [ScalarEvolution] Ensure backedge-taken counts are not pointers.
A backedge-taken count doesn't refer to memory; returning a pointer type
is nonsense. So make sure we always return an integer.

The obvious way to do this would be to just convert the operands of the
icmp to integers, but that doesn't quite work out at the moment:
isLoopEntryGuardedByCond currently gets confused by ptrtoint operations.
So we perform the ptrtoint conversion late for lt/gt operations.

The test changes are mostly innocuous. The most interesting changes are
more complex SCEV expressions of the form "(-1 * (ptrtoint i8* %ptr to
i64)) + %ptr)". This is expected: we can't fold this to zero because we
need to preserve the pointer base.

The call to isLoopEntryGuardedByCond in howFarToZero is less precise
because of ptrtoint operations; this shows up in the function
pr46786_c26_char in ptrtoint.ll. Fixing it here would require more
complex refactoring.  It should eventually be fixed by future
improvements to isImpliedCond.

See https://bugs.llvm.org/show_bug.cgi?id=46786 for context.

Differential Revision: https://reviews.llvm.org/D103656
2021-06-21 16:24:16 -07:00
..
basic.ll
basic32iters.ll
complex_reroll.ll
external_use.ll
extra_instr.ll [LoopReroll] Fix rerolling loop with extra instructions 2021-04-23 15:14:46 +09:00
indvar_with_ext.ll
negative.ll
nonconst_lb.ll [SCEV] Strength nowrap flags after constant folding 2020-10-25 18:00:22 +01:00
ptrindvar.ll [ScalarEvolution] Ensure backedge-taken counts are not pointers. 2021-06-21 16:24:16 -07:00
reduction.ll
reroll_with_dbg.ll Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00