aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorEli Friedman <efriedma@quicinc.com>2021-06-21 16:24:16 -0700
committerEli Friedman <efriedma@quicinc.com>2021-06-21 16:24:16 -0700
commit8f3d16905d75b07a933d01dc29677fe5867c1b3e (patch)
tree036004f6076dee808d1bd685706c34cc4f41bbbe /llvm/lib/CodeGen/MachineFunction.cpp
parentad1a9d629b759f43c8c1ea5d4c710c5c5b4b1e6b (diff)
downloadllvm-8f3d16905d75b07a933d01dc29677fe5867c1b3e.zip
llvm-8f3d16905d75b07a933d01dc29677fe5867c1b3e.tar.gz
llvm-8f3d16905d75b07a933d01dc29677fe5867c1b3e.tar.bz2
[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
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
0 files changed, 0 insertions, 0 deletions