[PATCH] D48491: [X86] Select BEXTR when there is only BMI1.

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 22 10:04:11 PDT 2018


lebedev.ri created this revision.
lebedev.ri added reviewers: craig.topper, RKSimon, spatel.
lebedev.ri added a dependency: D48490: [NFC][x86][AArch64] Add BEXTR-like test patterns..

This does catch all the cases the `BZHI` case does.
And does not duplicate all the patterns.

I'm not sure if we want to squeeze the `LSHR` into the `BEXTR` itself.

Now that i have actually done this, i'm having second thoughts.
This clearly results in less instructions, which is great, since this
is quite common code pattern in some hottest bit manipulation loops.
But i'm having a bit of hard time coming up with the right sequence
of instructions to model the old output via llvm-mca..

Also, **FIXME**, can i somehow pass just the `GR32:$lz`,
is there some NOP dag node that would just return it's only argument?


Repository:
  rL LLVM

https://reviews.llvm.org/D48491

Files:
  lib/Target/X86/X86InstrCompiler.td
  lib/Target/X86/X86InstrInfo.td
  test/CodeGen/X86/extract-bits.ll
  test/CodeGen/X86/extract-lowbits.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48491.152503.patch
Type: text/x-patch
Size: 93007 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180622/1ddd04bb/attachment.bin>


More information about the llvm-commits mailing list