[PATCH] D67875: [X86] X86DAGToDAGISel::matchBEXTRFromAndImm(): if can't use BEXTR, fallback to BZHI (PR43381)

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 22 14:54:19 PDT 2019


craig.topper accepted this revision.
craig.topper added a comment.
This revision is now accepted and ready to land.

LGTM with those comment fixes.



================
Comment at: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:3485
 
-  SDValue New = CurDAG->getTargetConstant(Shift | (MaskSize << 8), dl, NVT);
-  unsigned ROpc = NVT == MVT::i64 ? X86::BEXTRI64ri : X86::BEXTRI32ri;
-  unsigned MOpc = NVT == MVT::i64 ? X86::BEXTRI64mi : X86::BEXTRI32mi;
+  // BZHI, if avaliable, is always fast, unlike BEXTR. But even if we decide
+  // that we can't use BEXTR, it is only worthwhile using BZHI if the mask
----------------
available*


================
Comment at: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:3487
+  // that we can't use BEXTR, it is only worthwhile using BZHI if the mask
+  //.does not fit into 32 bits. Load folding is not a sufficient reason.
+  if (!PreferBEXTR && MaskSize <= 32)
----------------
Stray period at the beginning of the comment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67875





More information about the llvm-commits mailing list