[PATCH] D130433: [InstCombine] Add fold for redundant sign bits count comparison

David Majnemer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 25 14:14:27 PDT 2022


majnemer added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:1674
+  const APInt *ShiftC;
+  if (!match(Xor, m_c_Xor(m_Value(X), m_AShr(m_Deferred(X), m_APInt(ShiftC)))))
+    return nullptr;
----------------
Might be simpler with `m_ConstantInt(Shift)` so you don't need to explicitly unwrap the APInt.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130433



More information about the llvm-commits mailing list