[PATCH] D52426: [X86] Move X86DAGToDAGISel::matchBEXTRFromAnd() into X86ISelLowering [WIP]

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 24 08:45:56 PDT 2018


lebedev.ri created this revision.
lebedev.ri added reviewers: RKSimon, craig.topper, spatel.

This is an attempt at continuation of https://reviews.llvm.org/D52293.
As discussed in PR38938 <https://bugs.llvm.org/show_bug.cgi?id=38938>,
we fail to emit `BEXTR` if the mask is shifted.
We can't deal with that in `X86DAGToDAGISel` `before the address mode for the inc is selected`,
and we can't really do it in the normal DAGCombine, because we don't have generic `ISD::BitFieldExtract` node,
and if we simply turn the shifted mask into a normal mask + shift-left, it will be folded back.
So it would seem X86ISelLowering is the place to handle this.

I do not understand what is going on with the @test_x86_tbm_bextri_u32_z2 and @test_x86_tbm_bextri_u64_z2 in test/CodeGen/X86/tbm_patterns.ll
That seems to be a miscompile.


Repository:
  rL LLVM

https://reviews.llvm.org/D52426

Files:
  lib/Target/X86/X86ISelDAGToDAG.cpp
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/bmi-x86_64.ll
  test/CodeGen/X86/extract-bits.ll
  test/CodeGen/X86/selectcc-to-shiftand.ll
  test/CodeGen/X86/tbm_patterns.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52426.166697.patch
Type: text/x-patch
Size: 13812 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180924/d4ccfe4c/attachment.bin>


More information about the llvm-commits mailing list