[PATCH] D48768: [X86] When have BMI2, prefer shifts to clear low/high bits, rather than variable mask.

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 21 04:26:08 PDT 2018


lebedev.ri added inline comments.


================
Comment at: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:4193-4194
+  auto matchMask = [&OuterShift, &InnerShift, &Y](SDValue M) -> bool {
+    if (!M.hasOneUse())
+      return false;
+    OuterShift = M->getOpcode();
----------------
Hmm, this effectively killed test coverage for this pattern for BZHI/BEXTR..
It wouldn't be too much of a problem to just match the expanded pattern there,
but we only unfold if the mask is one-use.. 


Repository:
  rL LLVM

https://reviews.llvm.org/D48768





More information about the llvm-commits mailing list