[PATCH] D109149: [DAG] Fold select_cc setgt X, -1, C, ~C -> xor (ashr X, BW-1), C

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 3 06:17:44 PDT 2021


spatel added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:22865
+  // Fold select_CC setlt X, 0, C, ~C -> xor (ashr X, BW-1), ~C
+  if (!NotExtCompare && N1C && N2C && N3C &&
+      N2C->getAPIntValue() == ~N3C->getAPIntValue() &&
----------------
Should there be a hasOneUse check on the condition op (N0)? Need to add a (potentially negative) test?


================
Comment at: llvm/test/CodeGen/PowerPC/testComparesi32ltu.ll:75
 ; CHECK-P10-LE-LABEL: testCompare1:
-; CHECK-P10-LE:         .localentry testCompare1, 1
-; CHECK-P10-LE-NEXT:  # %bb.0: # %entry
+; CHECK-P10-LE:       # %bb.0: # %entry
 ; CHECK-P10-LE-NEXT:    plbz r4, testCompare1 at PCREL(0), 1
----------------
What is happening on this test?


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

https://reviews.llvm.org/D109149



More information about the llvm-commits mailing list