[all-commits] [llvm/llvm-project] 375849: [X86] Add a X86ISD::BEXTRI to distinquish the case...

topperc via All-commits all-commits at lists.llvm.org
Sat Oct 10 19:41:08 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 375849518db97096212f7f2b996b0d15f97be959
      https://github.com/llvm/llvm-project/commit/375849518db97096212f7f2b996b0d15f97be959
  Author: Craig Topper <craig.topper at intel.com>
  Date:   2020-10-10 (Sat, 10 Oct 2020)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/lib/Target/X86/X86ISelLowering.h
    M llvm/lib/Target/X86/X86InstrInfo.td
    M llvm/lib/Target/X86/X86IntrinsicsInfo.h

  Log Message:
  -----------
  [X86] Add a X86ISD::BEXTRI to distinquish the case where the control must be a constant.

The bextri intrinsic has a ImmArg attribute which will be converted
in SelectionDAG using TargetConstant. We previously converted this
to a plain Constant to allow X86ISD::BEXTR to call SimplifyDemandedBits
on it.

But while trying to decide if D89178 was safe, I realized that
this conversion of TargetConstant to Constant would be one case
where that would break.

So this patch adds a new opcode specifically for the immediate case.
And then teaches computeKnownBits and SimplifyDemandedBits to also
handle it, but not try to SimplifyDemandedBits on it. To make up
for that, I immediately masked the constant to 16 bits when
converting from the intrinsic node to the X86ISD node.




More information about the All-commits mailing list