[PATCH] D142542: [InstSimplify] Simplify icmp between Left-Shifted VScale Calls

Matt Devereau via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 07:19:52 PST 2023


MattDevereau 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))) ||
----------------
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


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