[llvm] r187667 - [mips] Expand vector truncating stores and extending loads.

Akira Hatanaka ahatanaka at mips.com
Fri Aug 2 12:23:33 PDT 2013


Author: ahatanak
Date: Fri Aug  2 14:23:33 2013
New Revision: 187667

URL: http://llvm.org/viewvc/llvm-project?rev=187667&view=rev
Log:
[mips] Expand vector truncating stores and extending loads.

Added:
    llvm/trunk/test/CodeGen/Mips/dsp-vec-load-store.ll
Modified:
    llvm/trunk/lib/Target/Mips/MipsSEISelLowering.cpp

Modified: llvm/trunk/lib/Target/Mips/MipsSEISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsSEISelLowering.cpp?rev=187667&r1=187666&r2=187667&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsSEISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsSEISelLowering.cpp Fri Aug  2 14:23:33 2013
@@ -53,6 +53,20 @@ MipsSETargetLowering::MipsSETargetLoweri
       setOperationAction(ISD::BITCAST, VecTys[i], Legal);
     }
 
+    // Expand all truncating stores and extending loads.
+    unsigned FirstVT = (unsigned)MVT::FIRST_VECTOR_VALUETYPE;
+    unsigned LastVT = (unsigned)MVT::LAST_VECTOR_VALUETYPE;
+
+    for (unsigned VT0 = FirstVT; VT0 <= LastVT; ++VT0) {
+      for (unsigned VT1 = FirstVT; VT1 <= LastVT; ++VT1)
+        setTruncStoreAction((MVT::SimpleValueType)VT0,
+                            (MVT::SimpleValueType)VT1, Expand);
+
+      setLoadExtAction(ISD::SEXTLOAD, (MVT::SimpleValueType)VT0, Expand);
+      setLoadExtAction(ISD::ZEXTLOAD, (MVT::SimpleValueType)VT0, Expand);
+      setLoadExtAction(ISD::EXTLOAD, (MVT::SimpleValueType)VT0, Expand);
+    }
+
     setTargetDAGCombine(ISD::SHL);
     setTargetDAGCombine(ISD::SRA);
     setTargetDAGCombine(ISD::SRL);

Added: llvm/trunk/test/CodeGen/Mips/dsp-vec-load-store.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/dsp-vec-load-store.ll?rev=187667&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Mips/dsp-vec-load-store.ll (added)
+++ llvm/trunk/test/CodeGen/Mips/dsp-vec-load-store.ll Fri Aug  2 14:23:33 2013
@@ -0,0 +1,11 @@
+; RUN: llc -march=mipsel -mattr=+dsp < %s
+
+ at g1 = common global <2 x i8> zeroinitializer, align 2
+ at g0 = common global <2 x i8> zeroinitializer, align 2
+
+define void @extend_load_trunc_store_v2i8() {
+entry:
+  %0 = load <2 x i8>* @g1, align 2
+  store <2 x i8> %0, <2 x i8>* @g0, align 2
+  ret void
+}





More information about the llvm-commits mailing list