[llvm-commits] [llvm] r66647 - in /llvm/branches/Apple/Dib: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/vec_shuffle-36.ll
Bill Wendling
isanbard at gmail.com
Wed Mar 11 00:12:43 PDT 2009
Author: void
Date: Wed Mar 11 02:12:43 2009
New Revision: 66647
URL: http://llvm.org/viewvc/llvm-project?rev=66647&view=rev
Log:
Merge r66645 into Dib:
Fixed a v8i16 shuffle case that should generate a pshufb instead of a
pshuflw/hw.
Added:
llvm/branches/Apple/Dib/test/CodeGen/X86/vec_shuffle-36.ll
- copied unchanged from r66645, llvm/trunk/test/CodeGen/X86/vec_shuffle-36.ll
Modified:
llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp?rev=66647&r1=66646&r2=66647&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp Wed Mar 11 02:12:43 2009
@@ -3630,8 +3630,11 @@
// Rewrite the MaskVals and assign NewV to V1 if NewV now contains all the
// source words for the shuffle, to aid later transformations.
bool AllWordsInNewV = true;
+ bool InOrder[2] = { true, true };
for (unsigned i = 0; i != 8; ++i) {
int idx = MaskVals[i];
+ if (idx != (int)i)
+ InOrder[i/4] = false;
if (idx < 0 || (idx/4) == BestLoQuad || (idx/4) == BestHiQuad)
continue;
AllWordsInNewV = false;
@@ -3658,7 +3661,7 @@
// If we've eliminated the use of V2, and the new mask is a pshuflw or
// pshufhw, that's as cheap as it gets. Return the new shuffle.
- if (pshufhw || pshuflw) {
+ if ((pshufhw && InOrder[0]) || (pshuflw && InOrder[1])) {
MaskV.clear();
for (unsigned i = 0; i != 8; ++i)
MaskV.push_back((MaskVals[i] < 0) ? DAG.getUNDEF(MVT::i16)
More information about the llvm-commits
mailing list