[PATCH] D112262: [indvars] Rotate zext though icmp to reduce loop varying computation
Max Kazantsev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 25 22:53:42 PDT 2021
mkazantsev 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;
----------------
Looks more logical to check `ICmp->isUnsigned()` just where we checked it was icmp.
================
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:%.*]]
----------------
Please add a negative test where this doesn't work because of precision loss.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112262/new/
https://reviews.llvm.org/D112262
More information about the llvm-commits
mailing list