[PATCH] D77136: [X86] Do not assume types are legal in getFauxShuffleMask

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 31 05:32:10 PDT 2020


RKSimon added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:7528
+      return false;
     MVT SrcVT = Src.getSimpleValueType();
     unsigned NumSrcElts = SrcVT.getVectorNumElements();
----------------
Nice catch! We actually need to be more thorough, matching what we do for the extensions (further down the function):
```
SDValue Src = N.getOperand(0);
EVT SrcVT = Src.getValueType();

// Truncated source must be a simple vector.
if (!SrcVT.isSimple() || (SrcVT.getSizeInBits() % 128) != 0 ||
    (SrcVT.getScalarSizeInBits() % 8) != 0)
  return false;
```


================
Comment at: llvm/test/CodeGen/X86/shuffle-combine-crash-3.ll:60
+  %9 = and i1 %8, %7
+  br i1 %9, label %for.cond.9, label %if.then.i
+
----------------
This can probably be reduced/cleaned up more?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77136





More information about the llvm-commits mailing list