[PATCH] D46957: [x86] Lower some trunc + shuffle patterns to vpmov[q|d][b|w]

Gabor Buella via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 24 08:24:11 PDT 2018


GBuella added inline comments.


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:9429
+  while (I < Size) {
+    if (isInRange(Mask[I], TruncatedVectorStart, TruncatedVectorStart + Size))
+      return false;
----------------
GBuella wrote:
> RKSimon wrote:
> > GBuella wrote:
> > > RKSimon wrote:
> > > > Why can't you permit UNDEFs in the shuffle mask?
> > > I do permit undef here. The condition of the branch is what I don't permit.
> > Then why don't you use isUndefOrZeroOrInRange()?
> > ```
> > if (!isUndefOrZeroOrInRange(Mask.slice(Split, Size), TruncatedVectorStart, TruncatedVectorStart + Size))
> >   return false;
> > ```
> That would check for the wrong elements, wouldn't it?
> Maybe 
> ```
> OtherVectorStart = SwappedOps ? 0 : Size
> if (!isUndefOrZeroOrInRange(Mask.slice(Split, Size), OtherVectorStart, OtherVectorStart + Size))
>   return false;
> ```
> 
Then I would rather make a new function:
```
if (isAnyInRange(Mask.slice(Split, Size), TruncatedVectorStart, TruncatedVectorStart + Size))
  return false;
```


https://reviews.llvm.org/D46957





More information about the llvm-commits mailing list