[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
Sat Jun 30 04:56:31 PDT 2018


lebedev.ri updated this revision to Diff 153620.
lebedev.ri added a comment.

- Rebased ontop of more tests.
- Make it `DAGCombine` transform, instead of `X86InstrCompiler.td`
- Add `preferShiftsToClearExtremeBits()` Target Lowering Hook, defaults to `false`.
- X86: `preferShiftsToClearExtremeBits()` - true if BMI2 and 32/64 bit width.
- This exposed one more missing BZHI patternmatch (`@f64_bzhi` in `llvm/test/CodeGen/X86/replace-load-and-with-bzhi.ll` started failing.)


Repository:
  rL LLVM

https://reviews.llvm.org/D48768

Files:
  include/llvm/CodeGen/TargetLowering.h
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86ISelLowering.h
  lib/Target/X86/X86InstrInfo.td
  test/CodeGen/X86/clear-highbits.ll
  test/CodeGen/X86/clear-lowbits.ll
  test/CodeGen/X86/extract-lowbits.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48768.153620.patch
Type: text/x-patch
Size: 64283 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180630/200bb121/attachment.bin>


More information about the llvm-commits mailing list