This is an archive of the discontinued LLVM Phabricator instance.

[X86][BMI1] X86DAGToDAGISel: select BEXTR from x & (-1 >> (32 - y)) pattern
ClosedPublic

Authored by lebedev.ri on Oct 23 2018, 7:46 AM.

Details

Summary

The final pattern.
There is no test changes:

  • We are looking for the pattern with one-use of it's mask,
  • If the mask is one-use, D48768 will unfold it into pattern d.
  • Thus, the tests have extra-use on the mask.
  • Thus, only the BMI2 BZHI can be tested, and it already worked.
  • So there is no BMI1 test coverage, we just assume it works since it uses the same codepath.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon accepted this revision.Oct 30 2018, 3:12 AM

LGTM with a couple of style minors

lib/Target/X86/X86ISelDAGToDAG.cpp
2754 ↗(On Diff #170642)
ShiftAmt.getOpcode()
ShiftAmt.getOperand(0)
2777 ↗(On Diff #170642)
Mask.getOpcode()
Mask.getOperand(0)
Mask.getOperand(1)
This revision is now accepted and ready to land.Oct 30 2018, 3:12 AM

LGTM with a couple of style minors

Thank you for the review!

lebedev.ri marked 2 inline comments as done.

Rebased.

This revision was automatically updated to reflect the committed changes.