[PATCH] D52348: [X86][BMI1]: X86DAGToDAGISel: select BEXTR from x & ((1 << nbits) + (-1)) pattern

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 10 23:49:19 PDT 2018


craig.topper added inline comments.


================
Comment at: lib/Target/X86/X86ISelDAGToDAG.cpp:2674
+    // We should be adding all-ones constant (i.e. subtracting one.)
+    ConstantSDNode *AddCst = dyn_cast<ConstantSDNode>(Mask->getOperand(1));
+    if (!AddCst || !AddCst->isAllOnesValue())
----------------
I think you can use ISD::isAllOnesConstant


================
Comment at: lib/Target/X86/X86ISelDAGToDAG.cpp:2681
+      return false;
+    ConstantSDNode *ShlCst = dyn_cast<ConstantSDNode>(M0->getOperand(0));
+    if (!ShlCst || !ShlCst->isOne())
----------------
ISD::isOneConstant


Repository:
  rL LLVM

https://reviews.llvm.org/D52348





More information about the llvm-commits mailing list