[PATCH] D135633: [GlobalISel] Combine things like (z = x <= 0 ? z = x : z = 0) -> x & (x >> bw-1)

Hsiangkai Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 10 19:45:28 PDT 2022


HsiangKai added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:6118
+    auto Shift = B.buildAShr(Ty, X1, BW);
+    if (Pred == ICmpInst::ICMP_SGT || Pred == ICmpInst::ICMP_SGE)
+      Shift = B.buildNot(Ty, Shift);
----------------
You can use the captured `NeedsNot` here.


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

https://reviews.llvm.org/D135633



More information about the llvm-commits mailing list