[llvm-commits] [llvm] r51533 - in /llvm/trunk: include/llvm/IntrinsicsX86.td lib/Target/X86/X86InstrSSE.td lib/VMCore/AutoUpgrade.cpp test/Bitcode/sse2_punpck_qdq.ll test/Bitcode/sse2_punpck_qdq.ll.bc
Evan Cheng
evan.cheng at apple.com
Fri May 23 19:56:30 PDT 2008
Author: evancheng
Date: Fri May 23 21:56:30 2008
New Revision: 51533
URL: http://llvm.org/viewvc/llvm-project?rev=51533&view=rev
Log:
Eliminate x86.sse2.punpckh.qdq and x86.sse2.punpckl.qdq.
Added:
llvm/trunk/test/Bitcode/sse2_punpck_qdq.ll
llvm/trunk/test/Bitcode/sse2_punpck_qdq.ll.bc (with props)
Modified:
llvm/trunk/include/llvm/IntrinsicsX86.td
llvm/trunk/lib/Target/X86/X86InstrSSE.td
llvm/trunk/lib/VMCore/AutoUpgrade.cpp
Modified: llvm/trunk/include/llvm/IntrinsicsX86.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=51533&r1=51532&r2=51533&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IntrinsicsX86.td (original)
+++ llvm/trunk/include/llvm/IntrinsicsX86.td Fri May 23 21:56:30 2008
@@ -501,17 +501,6 @@
Intrinsic<[llvm_void_ty], [IntrWriteMem]>;
}
-// Shuffles.
-// FIXME: Temporary workarounds since 2-wide shuffle is broken.
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse2_punpckh_qdq : GCCBuiltin<"__builtin_ia32_punpckhqdq128">,
- Intrinsic<[llvm_v2i64_ty, llvm_v2i64_ty,
- llvm_v2i64_ty], [IntrNoMem]>;
- def int_x86_sse2_punpckl_qdq : GCCBuiltin<"__builtin_ia32_punpcklqdq128">,
- Intrinsic<[llvm_v2i64_ty, llvm_v2i64_ty,
- llvm_v2i64_ty], [IntrNoMem]>;
-}
-
//===----------------------------------------------------------------------===//
// SSE3
Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=51533&r1=51532&r2=51533&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Fri May 23 21:56:30 2008
@@ -3050,16 +3050,6 @@
def : Pat<(v2f64 (X86vzmovl (v2f64 VR128:$src))),
(MOVZPQILo2PQIrr VR128:$src)>, Requires<[HasSSE2]>;
-// FIXME: Temporary workaround since 2-wide shuffle is broken.
-def : Pat<(int_x86_sse2_punpckh_qdq VR128:$src1, VR128:$src2),
- (v2i64 (PUNPCKHQDQrr VR128:$src1, VR128:$src2))>, Requires<[HasSSE2]>;
-def : Pat<(int_x86_sse2_punpckh_qdq VR128:$src1, (memop addr:$src2)),
- (v2i64 (PUNPCKHQDQrm VR128:$src1, addr:$src2))>, Requires<[HasSSE2]>;
-def : Pat<(int_x86_sse2_punpckl_qdq VR128:$src1, VR128:$src2),
- (v2i64 (PUNPCKLQDQrr VR128:$src1, VR128:$src2))>, Requires<[HasSSE2]>;
-def : Pat<(int_x86_sse2_punpckl_qdq VR128:$src1, (memop addr:$src2)),
- (PUNPCKLQDQrm VR128:$src1, addr:$src2)>, Requires<[HasSSE2]>;
-
// Some special case pandn patterns.
def : Pat<(v2i64 (and (xor VR128:$src1, (bc_v2i64 (v4i32 immAllOnesV))),
VR128:$src2)),
Modified: llvm/trunk/lib/VMCore/AutoUpgrade.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AutoUpgrade.cpp?rev=51533&r1=51532&r2=51533&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AutoUpgrade.cpp (original)
+++ llvm/trunk/lib/VMCore/AutoUpgrade.cpp Fri May 23 21:56:30 2008
@@ -154,7 +154,9 @@
Name.compare(5,15,"x86.sse2.movs.d",15) == 0 ||
Name.compare(5,16,"x86.sse2.shuf.pd",16) == 0 ||
Name.compare(5,18,"x86.sse2.unpckh.pd",18) == 0 ||
- Name.compare(5,18,"x86.sse2.unpckl.pd",18) == 0 ) {
+ Name.compare(5,18,"x86.sse2.unpckl.pd",18) == 0 ||
+ Name.compare(5,20,"x86.sse2.punpckh.qdq",20) == 0 ||
+ Name.compare(5,20,"x86.sse2.punpckl.qdq",20) == 0) {
// Calls to these intrinsics are transformed into ShuffleVector's.
NewFn = 0;
return true;
@@ -193,6 +195,7 @@
bool isLoadH = false, isLoadL = false, isMovL = false;
bool isMovSD = false, isShufPD = false;
bool isUnpckhPD = false, isUnpcklPD = false;
+ bool isPunpckhQPD = false, isPunpcklQPD = false;
if (strcmp(F->getNameStart(), "llvm.x86.sse2.loadh.pd") == 0)
isLoadH = true;
else if (strcmp(F->getNameStart(), "llvm.x86.sse2.loadl.pd") == 0)
@@ -207,9 +210,13 @@
isUnpckhPD = true;
else if (strcmp(F->getNameStart(), "llvm.x86.sse2.unpckl.pd") == 0)
isUnpcklPD = true;
+ else if (strcmp(F->getNameStart(), "llvm.x86.sse2.punpckh.qdq") == 0)
+ isPunpckhQPD = true;
+ else if (strcmp(F->getNameStart(), "llvm.x86.sse2.punpckl.qdq") == 0)
+ isPunpcklQPD = true;
if (isLoadH || isLoadL || isMovL || isMovSD || isShufPD ||
- isUnpckhPD || isUnpcklPD) {
+ isUnpckhPD || isUnpcklPD || isPunpckhQPD || isPunpcklQPD) {
std::vector<Constant*> Idxs;
Value *Op0 = CI->getOperand(1);
ShuffleVectorInst *SI = NULL;
@@ -246,12 +253,13 @@
Idxs.push_back(ConstantInt::get(Type::Int32Ty, 3));
Value *Mask = ConstantVector::get(Idxs);
SI = new ShuffleVectorInst(ZeroV, Op0, Mask, "upgraded.", CI);
- } else if (isMovSD || isUnpckhPD || isUnpcklPD) {
+ } else if (isMovSD ||
+ isUnpckhPD || isUnpcklPD || isPunpckhQPD || isPunpcklQPD) {
Value *Op1 = CI->getOperand(2);
if (isMovSD) {
Idxs.push_back(ConstantInt::get(Type::Int32Ty, 2));
Idxs.push_back(ConstantInt::get(Type::Int32Ty, 1));
- } else if (isUnpckhPD) {
+ } else if (isUnpckhPD || isPunpckhQPD) {
Idxs.push_back(ConstantInt::get(Type::Int32Ty, 1));
Idxs.push_back(ConstantInt::get(Type::Int32Ty, 3));
} else {
Added: llvm/trunk/test/Bitcode/sse2_punpck_qdq.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/sse2_punpck_qdq.ll?rev=51533&view=auto
==============================================================================
--- llvm/trunk/test/Bitcode/sse2_punpck_qdq.ll (added)
+++ llvm/trunk/test/Bitcode/sse2_punpck_qdq.ll Fri May 23 21:56:30 2008
@@ -0,0 +1,3 @@
+; RUN: llvm-dis < %s.bc | not grep {i32 @llvm\\.punpckh.qdq}
+; RUN: llvm-dis < %s.bc | not grep {i32 @llvm\\.punpckl.qdq}
+; RUN: llvm-dis < %s.bc | grep shufflevector
Added: llvm/trunk/test/Bitcode/sse2_punpck_qdq.ll.bc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/sse2_punpck_qdq.ll.bc?rev=51533&view=auto
==============================================================================
Binary file - no diff available.
Propchange: llvm/trunk/test/Bitcode/sse2_punpck_qdq.ll.bc
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
More information about the llvm-commits
mailing list