llvm-project/llvm/test/Transforms/LoopIdiom
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
..
AMDGPU
ARM
RISCV [RISCV] Add TTI support for cpop with Zbb 2021-03-24 10:58:42 -07:00
X86 [LoopIdiom] Add test case that involves adds with flags and zero exts. 2021-06-21 12:10:58 +01:00
basic-address-space.ll
basic.ll
crash.ll
ctpop-multiple-users-crash.ll
dbginfo-cost.ll
debug-line.ll
disable-options.ll
expander-do-not-delete-reused-values.ll
int_sideeffect.ll
lir-heurs-multi-block-loop.ll
memcpy-debugify-remarks.ll [loop-idiom] Hoist loop memcpys to loop preheader 2021-05-04 17:05:04 -07:00
memcpy-intrinsic-different-types.ll [loop-idiom] Hoist loop memcpys to loop preheader 2021-05-04 17:05:04 -07:00
memcpy-intrinsic.ll [loop-idiom] Hoist loop memcpys to loop preheader 2021-05-04 17:05:04 -07:00
memcpy-vectors.ll [SVE] Remove checks for warnings in scalable-vector tests. 2021-04-07 15:59:32 +01:00
memcpy.ll [LoopIdiom] Added testcase from PR44378; NFC 2021-04-21 22:00:32 +02:00
memset-debugify-remarks.ll [ScalarEvolution] Ensure backedge-taken counts are not pointers. 2021-06-21 16:24:16 -07:00
memset.ll [LoopIdiom] Added testcase for double memset (fixed in LLVM 12); NFC 2021-04-22 16:39:25 +02:00
memset_noidiom.ll
non-canonical-loop.ll
non-integral-pointers.ll
nontemporal_store.ll
phi-insertion.ll
pr28196.ll
pr33114.ll
reuse-cast.ll
scev-invalidation.ll
scev-invalidation_topmostloop.ll
struct-custom-dl.ll
struct.ll
struct_pattern.ll
unordered-atomic-memcpy-noarch.ll
unroll-custom-dl.ll
unroll.ll
unsafe.ll
unwind.ll