[PATCH] D57389: [X86] Improve use of SHLD/SHRD

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 7 15:40:28 PST 2019


craig.topper added inline comments.


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:37054
+        ShAmt1Op1 = ShAmt1Op1.getOperand(0);
+      }
       if (ShAmt1Op1.getOpcode() == ISD::TRUNCATE)
----------------
deadalnix wrote:
> craig.topper wrote:
> > deadalnix wrote:
> > > RKSimon wrote:
> > > > Maybe use DAG.GetDemandedBits ?
> > > It's not obvious to me that it would work. The and opcode itself uses it, so there is no need to redo it here. We also need to know if masking took place to know what we can accept as LHS for the sub opcode.
> > I know this code (Bits - 1) check is used in other places earlier in this function, but is that valid for i16 SHLD/SHRD? SHLD/SHRD hardware mask shift amount to 5 bits on i16/i32 and 6 bits on i64. 
> I do not know if this is valid for i16. If that isn't, this code is bogous already. Would you have a test case I can rely on to do this ?
@RKSimon what are you thoughts on the existing uses of (Bits - 1) in this function for the i16 case? Those seem wrong to me.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57389/new/

https://reviews.llvm.org/D57389





More information about the llvm-commits mailing list