[PATCH] D112262: [indvars] Rotate zext though icmp to reduce loop varying computation
Philip Reames via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 27 09:44:38 PDT 2021
reames added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1513
+ Value *LHSOp = nullptr;
+ if (!match(LHS, m_ZExt(m_Value(LHSOp))) || !ICmp->isUnsigned())
+ continue;
----------------
mkazantsev wrote:
> Looks more logical to check `ICmp->isUnsigned()` just where we checked it was icmp.
Not sure I agree, but done.
================
Comment at: llvm/test/Transforms/IndVarSimplify/finite-exit-comparisons.ll:471
; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = trunc i16 254 to i8
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
----------------
mkazantsev wrote:
> Please add a negative test where this doesn't work because of precision loss.
Already covered by @slt_neg_no_mustprogress
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112262/new/
https://reviews.llvm.org/D112262
More information about the llvm-commits
mailing list