[PATCH] D119715: [InstCombine] Fold sub(0,and(lshr(X,C),1)) --> ashr(shl(X,(BW-1)-C),BW-1) (PR53610)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 15 05:12:28 PST 2022


lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.

LGTM, thank you.



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp:253
+    Constant *ShAmt;
+    // sub(C1,and(lshr(X,C2),1)) --> add(ashr(shl(X,(BW-1)-C2),BW-1),C1)
+    if (match(I, m_c_And(m_OneUse(m_TruncOrSelf(
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119715



More information about the llvm-commits mailing list