summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/Mips/unalignedload.ll
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanak@gmail.com>2011-08-18 23:39:37 +0000
committerAkira Hatanaka <ahatanak@gmail.com>2011-08-18 23:39:37 +0000
commit5ac8547a412d1b42c5ff333fc0becd56b98b74cb (patch)
tree3112baec5b6ddc47da526e733d0b020985ff9f25 /test/CodeGen/Mips/unalignedload.ll
parent28bea08e531452992ff1e25e8584883dfbd4c232 (diff)
downloadexternal_llvm-5ac8547a412d1b42c5ff333fc0becd56b98b74cb.zip
external_llvm-5ac8547a412d1b42c5ff333fc0becd56b98b74cb.tar.gz
external_llvm-5ac8547a412d1b42c5ff333fc0becd56b98b74cb.tar.bz2
Use subword loads instead of a 4-byte load when the size of a structure (or a
piece of it) that is being passed by value is smaller than a word. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138007 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Mips/unalignedload.ll')
-rw-r--r--test/CodeGen/Mips/unalignedload.ll31
1 files changed, 28 insertions, 3 deletions
diff --git a/test/CodeGen/Mips/unalignedload.ll b/test/CodeGen/Mips/unalignedload.ll
index 072f057..433e896 100644
--- a/test/CodeGen/Mips/unalignedload.ll
+++ b/test/CodeGen/Mips/unalignedload.ll
@@ -1,16 +1,41 @@
-; RUN: llc -march=mips < %s | FileCheck %s
-
+; RUN: llc < %s -march=mipsel | FileCheck %s -check-prefix=CHECK-EL
+; RUN: llc < %s -march=mips | FileCheck %s -check-prefix=CHECK-EB
%struct.S2 = type { %struct.S1, %struct.S1 }
%struct.S1 = type { i8, i8 }
+%struct.S4 = type { [7 x i8] }
@s2 = common global %struct.S2 zeroinitializer, align 1
+@s4 = common global %struct.S4 zeroinitializer, align 1
define void @foo1() nounwind {
entry:
-; CHECK: ulw ${{[0-9]+}}, 2
+; CHECK-EL: lw $25, %call16(foo2)
+; CHECK-EL: ulhu $4, 2
+; CHECK-EL: lw $[[R0:[0-9]+]], %got(s4)
+; CHECK-EL: lbu $[[R1:[0-9]+]], 6($[[R0]])
+; CHECK-EL: ulhu $[[R2:[0-9]+]], 4($[[R0]])
+; CHECK-EL: sll $[[R3:[0-9]+]], $[[R1]], 16
+; CHECK-EL: ulw $4, 0($[[R0]])
+; CHECK-EL: lw $25, %call16(foo4)
+; CHECK-EL: or $5, $[[R2]], $[[R3]]
+
+; CHECK-EB: ulhu $[[R0:[0-9]+]], 2
+; CHECK-EB: lw $25, %call16(foo2)
+; CHECK-EB: sll $4, $[[R0]], 16
+; CHECK-EB: lw $[[R1:[0-9]+]], %got(s4)
+; CHECK-EB: ulhu $[[R2:[0-9]+]], 4($[[R1]])
+; CHECK-EB: lbu $[[R3:[0-9]+]], 6($[[R1]])
+; CHECK-EB: sll $[[R4:[0-9]+]], $[[R2]], 16
+; CHECK-EB: sll $[[R5:[0-9]+]], $[[R3]], 8
+; CHECK-EB: ulw $4, 0($[[R1]])
+; CHECK-EB: lw $25, %call16(foo4)
+; CHECK-EB: or $5, $[[R4]], $[[R5]]
tail call void @foo2(%struct.S1* byval getelementptr inbounds (%struct.S2* @s2, i32 0, i32 1)) nounwind
+ tail call void @foo4(%struct.S4* byval @s4) nounwind
ret void
}
declare void @foo2(%struct.S1* byval)
+
+declare void @foo4(%struct.S4* byval)