[PATCH] D142542: [InstSimplify] Simplify icmp between Left-Shifted VScale Calls
Dave Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 25 07:28:21 PST 2023
dmgreen added inline comments.
================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:3634
+ ConstantInt *IntLHS, *IntRHS;
+ if (!match(LHS, m_Shl(m_VScale(Q.DL), m_ConstantInt(IntLHS))) ||
+ !match(RHS, m_Shl(m_VScale(Q.DL), m_ConstantInt(IntRHS))) ||
----------------
MattDevereau wrote:
> sdesmalen wrote:
> > Does it matter that this is value is `vscale` ?
> >
> > I would expect that:
> > * `(X << C1) < (X << C2) == true` for any value `X` for any `C1 < C2`
> > * `(X << C1) <= (X << C2) == true` for any value `X` for any `C1 <= C2`
> > * `(X << C1) > (X << C2) == true` for any value `X` for any `C1 > C2`
> > * ...
> Very true, I think I got a bit too tunnel visioned on the original test case. I will replace the vscale checks with m_Value for LHS and m_Deferred for RHS, and remove any references to vscale in names
Make sure you check the value isn't 0, and it can be good to provide alive proofs.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D142542/new/
https://reviews.llvm.org/D142542
More information about the llvm-commits
mailing list