This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Fix combineVectorShuffle regression after D77448
ClosedPublic

Authored by MaskRay on Jul 10 2020, 11:41 PM.

Details

Summary

Commit 1fed131660b2 assumed that NewShuffle (shuffle vector
canonicalization result) will always be ShuffleVectorSDNode, which may
be false (it may be a BITCAST node):

...
t12: v4i32 = scalar_to_vector t2
t15: v16i8 = bitcast t12  # LHS
t17: v16i8 = vector_shuffle<u,u,u,u,u,u,u,u,0,1,2,3,u,u,u,u> t15, undef:v16i8  # SVN

Diff Detail

Event Timeline

MaskRay created this revision.Jul 10 2020, 11:41 PM
MaskRay updated this revision to Diff 277223.Jul 11 2020, 12:26 AM
MaskRay edited the summary of this revision. (Show Details)

Improve test

nemanjai accepted this revision.Jul 13 2020, 4:31 PM

LGTM. Thanks for fixing this.

llvm/lib/Target/PowerPC/PPCISelLowering.cpp
9906

If the result is not a shuffle, I don't think we need to continue custom lowering it here. Perhaps this should just be:

if (!isa<ShuffleVectorSDNode>(NewShuffle))
  return NewShuffle;
This revision is now accepted and ready to land.Jul 13 2020, 4:31 PM
MaskRay updated this revision to Diff 277618.Jul 13 2020, 4:56 PM
MaskRay marked an inline comment as done.

Address comments

This revision was automatically updated to reflect the committed changes.