diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-08-04 01:14:24 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-08-04 01:14:24 +0000 |
commit | 37a18821cd8b0df5ac877659d2d397f0e268407c (patch) | |
tree | d537d3e1d271f6cc2dea8589b603911cec9b57c3 /llvm/lib | |
parent | 7bbfd245b08fda1503ec7e3c6954c100235cdee2 (diff) | |
download | bcm5719-llvm-37a18821cd8b0df5ac877659d2d397f0e268407c.tar.gz bcm5719-llvm-37a18821cd8b0df5ac877659d2d397f0e268407c.zip |
[x86] Handle single input shuffles in the SSSE3 case more intelligently.
I spent some time looking into a better or more principled way to handle
this. For example, by detecting arbitrary "unneeded" ORs... But really,
there wasn't any point. We just shouldn't build blatantly wrong code so
late in the pipeline rather than adding more stages and logic later on
to fix it. Avoiding this is just too simple.
llvm-svn: 214680
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 5ae752c1da5..94c19fb4c40 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -7931,6 +7931,10 @@ static SDValue lowerV16I8VectorShuffle(SDValue Op, SDValue V1, SDValue V2, } V1 = DAG.getNode(X86ISD::PSHUFB, DL, MVT::v16i8, V1, DAG.getNode(ISD::BUILD_VECTOR, DL, MVT::v16i8, V1Mask)); + if (isSingleInputShuffleMask(Mask)) + return V1; // Single inputs are easy. + + // Otherwise, blend the two. V2 = DAG.getNode(X86ISD::PSHUFB, DL, MVT::v16i8, V2, DAG.getNode(ISD::BUILD_VECTOR, DL, MVT::v16i8, V2Mask)); return DAG.getNode(ISD::OR, DL, MVT::v16i8, V1, V2); |