[PATCH] D148440: [InstCombine] Fold zext(shl(trunc)) into and(shl)

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 15 15:43:58 PDT 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp:1214
+  const APInt *C1;
+  if (match(Src, m_Shl(m_Trunc(m_Value(X)), m_APInt(C1))) &&
+      X->getType() == DestTy) {
----------------
Why only `shl`, this seems to be pretty generically true:
https://alive2.llvm.org/ce/z/kTBKC7


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148440



More information about the llvm-commits mailing list