[PATCH] D121551: [InstCombine] Add general constant support to eq/ne icmp(add(X,C1),add(Y,C2)) -> icmp(add(X,C1-C2),Y) fold

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 14 07:45:12 PDT 2022


RKSimon added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:4138
+    Constant *Cst1, *Cst2;
+    if (match(B, m_Constant(Cst1)) && match(D, m_Constant(Cst2)) &&
+        ICmpInst::isEquality(Pred)) {
----------------
nikic wrote:
> ImmConstant?
I guess I should add constexpr tests


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121551/new/

https://reviews.llvm.org/D121551



More information about the llvm-commits mailing list