[PATCH] D23000: [X86] Improve 64-bit shifts on 32-bit targets (PR14593)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 31 08:51:51 PDT 2016


eli.friedman added a comment.

Might be nice to have a test which triggers this combine without going through legalization.  (Should be possible, I think?)


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:28675
@@ +28674,3 @@
+          isa<ConstantSDNode>(Op1.getOperand(1)) &&
+          Op1.getConstantOperandVal(1) == 1) {
+        return DAG.getNode(Opc, DL, VT, Op0, Op1.getOperand(0),
----------------
Maybe it makes sense to split this into two separate if statements; one checking that the two outer shifts match, one checking that the inner shift is a shift by one.  I found it a bit tricky to pick through.  (I sort of wish we had an equivalent to IR pattern matching in SelectionDAG.)


Repository:
  rL LLVM

https://reviews.llvm.org/D23000





More information about the llvm-commits mailing list