[PATCH] D147597: [InstCombine] icmp(X | LHS, C) --> icmp(X, 0)
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 12 00:19:13 PDT 2023
nikic added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:1957
+ const APInt *LHS;
+ // icmp(X | LHS, C) --> icmp(X, 0)
+ if (C.isNonNegative() && match(Or, m_c_Or(m_Value(X), m_APInt(LHS)))) {
----------------
Why is a constant that occurs on the RHS called LHS?
================
Comment at: llvm/test/Transforms/InstCombine/icmp.ll:4633
; CHECK-LABEL: @mul_or_positive_sgt_zero(
; CHECK-NEXT: [[MUL1:%.*]] = mul i8 [[A:%.*]], [[B:%.*]]
+; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i8 [[MUL1]], -1
----------------
What's the purpose of the mul instruction in all these tests? It doesn't seem related?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D147597/new/
https://reviews.llvm.org/D147597
More information about the llvm-commits
mailing list