aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen
diff options
context:
space:
mode:
authorJan Voung <jvoung@chromium.org>2013-06-25 13:53:13 -0700
committerJan Voung <jvoung@chromium.org>2013-06-25 13:53:13 -0700
commitf0392b56ec11466992bac898e12144a32b843077 (patch)
treefd7ce7d4677d1d50b836395b309f5972d9a340b6 /test/CodeGen
parent8811efb18b978645cf5ef8a88a9b57066c21ff1f (diff)
Revert "Apply upstream r183551, r183601, r183624 and r183794"
Revert this until we fix i1 sext. Currently, it uses LSL and ASR, which are pseudo-instructions and get dropped on the floor when generating .o files. We'll fix that, but for now revert to green the bots. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3501 R=jfb@chromium.org Review URL: https://codereview.chromium.org/17715002
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/ARM/2013-05-31-char-shift-crash.ll21
-rw-r--r--test/CodeGen/ARM/fast-isel-call.ll28
-rw-r--r--test/CodeGen/ARM/fast-isel-conversion.ll8
-rw-r--r--test/CodeGen/ARM/fast-isel-ext.ll134
-rw-r--r--test/CodeGen/ARM/fast-isel-fold.ll4
-rw-r--r--test/CodeGen/ARM/fast-isel-icmp.ll8
-rw-r--r--test/CodeGen/ARM/fast-isel-intrinsic.ll4
-rw-r--r--test/CodeGen/ARM/fast-isel-ret.ll2
-rw-r--r--test/CodeGen/ARM/fast-isel.ll8
9 files changed, 29 insertions, 188 deletions
diff --git a/test/CodeGen/ARM/2013-05-31-char-shift-crash.ll b/test/CodeGen/ARM/2013-05-31-char-shift-crash.ll
deleted file mode 100644
index 0130f7ab68..0000000000
--- a/test/CodeGen/ARM/2013-05-31-char-shift-crash.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: llc < %s -O0 -mtriple=armv4t--linux-eabi-android
-; RUN: llc < %s -O0 -mtriple=armv4t-unknown-linux
-; RUN: llc < %s -O0 -mtriple=armv5-unknown-linux
-
-; See http://llvm.org/bugs/show_bug.cgi?id=16178
-; ARMFastISel used to fail emitting sext/zext in pre-ARMv6.
-
-; Function Attrs: nounwind
-define arm_aapcscc void @f2(i8 signext %a) #0 {
-entry:
- %a.addr = alloca i8, align 1
- store i8 %a, i8* %a.addr, align 1
- %0 = load i8* %a.addr, align 1
- %conv = sext i8 %0 to i32
- %shr = ashr i32 %conv, 56
- %conv1 = trunc i32 %shr to i8
- call arm_aapcscc void @f1(i8 signext %conv1)
- ret void
-}
-
-declare arm_aapcscc void @f1(i8 signext) #1
diff --git a/test/CodeGen/ARM/fast-isel-call.ll b/test/CodeGen/ARM/fast-isel-call.ll
index 3833043ad7..55911e5c1c 100644
--- a/test/CodeGen/ARM/fast-isel-call.ll
+++ b/test/CodeGen/ARM/fast-isel-call.ll
@@ -51,9 +51,9 @@ define void @foo(i8 %a, i16 %b) nounwind {
; THUMB: sxtb r2, r1
; THUMB: mov r0, r2
%2 = call i32 @t1(i8 signext %a)
-; ARM: and r2, r1, #255
+; ARM: uxtb r2, r1
; ARM: mov r0, r2
-; THUMB: and r2, r1, #255
+; THUMB: uxtb r2, r1
; THUMB: mov r0, r2
%3 = call i32 @t2(i8 zeroext %a)
; ARM: sxth r2, r1
@@ -101,13 +101,13 @@ entry:
; ARM: movw [[R3:l?r[0-9]*]], #28
; ARM: movw [[R4:l?r[0-9]*]], #40
; ARM: movw [[R5:l?r[0-9]*]], #186
-; ARM: and [[R0]], [[R0]], #255
-; ARM: and [[R1]], [[R1]], #255
-; ARM: and [[R2]], [[R2]], #255
-; ARM: and [[R3]], [[R3]], #255
-; ARM: and [[R4]], [[R4]], #255
+; ARM: uxtb [[R0]], [[R0]]
+; ARM: uxtb [[R1]], [[R1]]
+; ARM: uxtb [[R2]], [[R2]]
+; ARM: uxtb [[R3]], [[R3]]
+; ARM: uxtb [[R4]], [[R4]]
; ARM: str [[R4]], [sp]
-; ARM: and [[R4]], [[R5]], #255
+; ARM: uxtb [[R4]], [[R5]]
; ARM: str [[R4]], [sp, #4]
; ARM: bl {{_?}}bar
; ARM-LONG: @t10
@@ -128,13 +128,13 @@ entry:
; THUMB: movt [[R4]], #0
; THUMB: movw [[R5:l?r[0-9]*]], #186
; THUMB: movt [[R5]], #0
-; THUMB: and [[R0]], [[R0]], #255
-; THUMB: and [[R1]], [[R1]], #255
-; THUMB: and [[R2]], [[R2]], #255
-; THUMB: and [[R3]], [[R3]], #255
-; THUMB: and [[R4]], [[R4]], #255
+; THUMB: uxtb [[R0]], [[R0]]
+; THUMB: uxtb [[R1]], [[R1]]
+; THUMB: uxtb [[R2]], [[R2]]
+; THUMB: uxtb [[R3]], [[R3]]
+; THUMB: uxtb.w [[R4]], [[R4]]
; THUMB: str.w [[R4]], [sp]
-; THUMB: and [[R4]], [[R5]], #255
+; THUMB: uxtb.w [[R4]], [[R5]]
; THUMB: str.w [[R4]], [sp, #4]
; THUMB: bl {{_?}}bar
; THUMB-LONG: @t10
diff --git a/test/CodeGen/ARM/fast-isel-conversion.ll b/test/CodeGen/ARM/fast-isel-conversion.ll
index e40891a2dd..91034fb24f 100644
--- a/test/CodeGen/ARM/fast-isel-conversion.ll
+++ b/test/CodeGen/ARM/fast-isel-conversion.ll
@@ -131,11 +131,11 @@ entry:
define void @uitofp_single_i8(i8 %a) nounwind ssp {
entry:
; ARM: uitofp_single_i8
-; ARM: and r0, r0, #255
+; ARM: uxtb r0, r0
; ARM: vmov s0, r0
; ARM: vcvt.f32.u32 s0, s0
; THUMB: uitofp_single_i8
-; THUMB: and r0, r0, #255
+; THUMB: uxtb r0, r0
; THUMB: vmov s0, r0
; THUMB: vcvt.f32.u32 s0, s0
%b.addr = alloca float, align 4
@@ -177,11 +177,11 @@ entry:
define void @uitofp_double_i8(i8 %a, double %b) nounwind ssp {
entry:
; ARM: uitofp_double_i8
-; ARM: and r0, r0, #255
+; ARM: uxtb r0, r0
; ARM: vmov s0, r0
; ARM: vcvt.f64.u32 d16, s0
; THUMB: uitofp_double_i8
-; THUMB: and r0, r0, #255
+; THUMB: uxtb r0, r0
; THUMB: vmov s0, r0
; THUMB: vcvt.f64.u32 d16, s0
%b.addr = alloca double, align 8
diff --git a/test/CodeGen/ARM/fast-isel-ext.ll b/test/CodeGen/ARM/fast-isel-ext.ll
deleted file mode 100644
index cb6e9ba1a1..0000000000
--- a/test/CodeGen/ARM/fast-isel-ext.ll
+++ /dev/null
@@ -1,134 +0,0 @@
-; RUN: llc < %s -O0 -fast-isel-abort -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=v7
-; RUN: llc < %s -O0 -fast-isel-abort -mtriple=armv4t-apple-ios | FileCheck %s --check-prefix=prev6
-; RUN: llc < %s -O0 -fast-isel-abort -mtriple=armv5-apple-ios | FileCheck %s --check-prefix=prev6
-; RUN: llc < %s -O0 -fast-isel-abort -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=v7
-
-; Can't test pre-ARMv6 Thumb because ARM FastISel currently only supports
-; Thumb2. The ARMFastISel::ARMEmitIntExt code should work for Thumb by always
-; using two shifts.
-
-; Note that lsl, asr and lsr in Thumb are all encoded as 16-bit instructions
-; and therefore must set flags. {{s?}} below denotes this, instead of
-; duplicating tests.
-
-; zext
-
-define i8 @zext_1_8(i1 %a) nounwind ssp {
-; v7: zext_1_8:
-; v7: and r0, r0, #1
-; prev6: zext_1_8:
-; prev6: and r0, r0, #1
- %r = zext i1 %a to i8
- ret i8 %r
-}
-
-define i16 @zext_1_16(i1 %a) nounwind ssp {
-; v7: zext_1_16:
-; v7: and r0, r0, #1
-; prev6: zext_1_16:
-; prev6: and r0, r0, #1
- %r = zext i1 %a to i16
- ret i16 %r
-}
-
-define i32 @zext_1_32(i1 %a) nounwind ssp {
-; v7: zext_1_32:
-; v7: and r0, r0, #1
-; prev6: zext_1_32:
-; prev6: and r0, r0, #1
- %r = zext i1 %a to i32
- ret i32 %r
-}
-
-define i16 @zext_8_16(i8 %a) nounwind ssp {
-; v7: zext_8_16:
-; v7: and r0, r0, #255
-; prev6: zext_8_16:
-; prev6: and r0, r0, #255
- %r = zext i8 %a to i16
- ret i16 %r
-}
-
-define i32 @zext_8_32(i8 %a) nounwind ssp {
-; v7: zext_8_32:
-; v7: and r0, r0, #255
-; prev6: zext_8_32:
-; prev6: and r0, r0, #255
- %r = zext i8 %a to i32
- ret i32 %r
-}
-
-define i32 @zext_16_32(i16 %a) nounwind ssp {
-; v7: zext_16_32:
-; v7: uxth r0, r0
-; prev6: zext_16_32:
-; prev6: lsl{{s?}} r0, r0, #16
-; prev6: lsr{{s?}} r0, r0, #16
- %r = zext i16 %a to i32
- ret i32 %r
-}
-
-; sext
-
-define i8 @sext_1_8(i1 %a) nounwind ssp {
-; v7: sext_1_8:
-; v7: lsl{{s?}} r0, r0, #31
-; v7: asr{{s?}} r0, r0, #31
-; prev6: sext_1_8:
-; prev6: lsl{{s?}} r0, r0, #31
-; prev6: asr{{s?}} r0, r0, #31
- %r = sext i1 %a to i8
- ret i8 %r
-}
-
-define i16 @sext_1_16(i1 %a) nounwind ssp {
-; v7: sext_1_16:
-; v7: lsl{{s?}} r0, r0, #31
-; v7: asr{{s?}} r0, r0, #31
-; prev6: sext_1_16:
-; prev6: lsl{{s?}} r0, r0, #31
-; prev6: asr{{s?}} r0, r0, #31
- %r = sext i1 %a to i16
- ret i16 %r
-}
-
-define i32 @sext_1_32(i1 %a) nounwind ssp {
-; v7: sext_1_32:
-; v7: lsl{{s?}} r0, r0, #31
-; v7: asr{{s?}} r0, r0, #31
-; prev6: sext_1_32:
-; prev6: lsl{{s?}} r0, r0, #31
-; prev6: asr{{s?}} r0, r0, #31
- %r = sext i1 %a to i32
- ret i32 %r
-}
-
-define i16 @sext_8_16(i8 %a) nounwind ssp {
-; v7: sext_8_16:
-; v7: sxtb r0, r0
-; prev6: sext_8_16:
-; prev6: lsl{{s?}} r0, r0, #24
-; prev6: asr{{s?}} r0, r0, #24
- %r = sext i8 %a to i16
- ret i16 %r
-}
-
-define i32 @sext_8_32(i8 %a) nounwind ssp {
-; v7: sext_8_32:
-; v7: sxtb r0, r0
-; prev6: sext_8_32:
-; prev6: lsl{{s?}} r0, r0, #24
-; prev6: asr{{s?}} r0, r0, #24
- %r = sext i8 %a to i32
- ret i32 %r
-}
-
-define i32 @sext_16_32(i16 %a) nounwind ssp {
-; v7: sext_16_32:
-; v7: sxth r0, r0
-; prev6: sext_16_32:
-; prev6: lsl{{s?}} r0, r0, #16
-; prev6: asr{{s?}} r0, r0, #16
- %r = sext i16 %a to i32
- ret i32 %r
-}
diff --git a/test/CodeGen/ARM/fast-isel-fold.ll b/test/CodeGen/ARM/fast-isel-fold.ll
index e8ed8cbf34..38e1f884bf 100644
--- a/test/CodeGen/ARM/fast-isel-fold.ll
+++ b/test/CodeGen/ARM/fast-isel-fold.ll
@@ -9,11 +9,9 @@ define void @t1() nounwind uwtable ssp {
; ARM: t1
; ARM: ldrb
; ARM-NOT: uxtb
-; ARM-NOT: and{{.*}}, #255
; THUMB: t1
; THUMB: ldrb
; THUMB-NOT: uxtb
-; THUMB-NOT: and{{.*}}, #255
%1 = load i8* @a, align 1
call void @foo1(i8 zeroext %1)
ret void
@@ -38,11 +36,9 @@ define i32 @t3() nounwind uwtable ssp {
; ARM: t3
; ARM: ldrb
; ARM-NOT: uxtb
-; ARM-NOT: and{{.*}}, #255
; THUMB: t3
; THUMB: ldrb
; THUMB-NOT: uxtb
-; THUMB-NOT: and{{.*}}, #255
%1 = load i8* @a, align 1
%2 = zext i8 %1 to i32
ret i32 %2
diff --git a/test/CodeGen/ARM/fast-isel-icmp.ll b/test/CodeGen/ARM/fast-isel-icmp.ll
index 3dc1109165..04a92825af 100644
--- a/test/CodeGen/ARM/fast-isel-icmp.ll
+++ b/test/CodeGen/ARM/fast-isel-icmp.ll
@@ -50,12 +50,12 @@ entry:
define i32 @icmp_i8_unsigned(i8 %a, i8 %b) nounwind {
entry:
; ARM: icmp_i8_unsigned
-; ARM: and r0, r0, #255
-; ARM: and r1, r1, #255
+; ARM: uxtb r0, r0
+; ARM: uxtb r1, r1
; ARM: cmp r0, r1
; THUMB: icmp_i8_unsigned
-; THUMB: and r0, r0, #255
-; THUMB: and r1, r1, #255
+; THUMB: uxtb r0, r0
+; THUMB: uxtb r1, r1
; THUMB: cmp r0, r1
%cmp = icmp ugt i8 %a, %b
%conv2 = zext i1 %cmp to i32
diff --git a/test/CodeGen/ARM/fast-isel-intrinsic.ll b/test/CodeGen/ARM/fast-isel-intrinsic.ll
index bcdcdeb1ea..f92a702960 100644
--- a/test/CodeGen/ARM/fast-isel-intrinsic.ll
+++ b/test/CodeGen/ARM/fast-isel-intrinsic.ll
@@ -19,7 +19,7 @@ define void @t1() nounwind ssp {
; ARM: add r0, r0, #5
; ARM: movw r1, #64
; ARM: movw r2, #10
-; ARM: and r1, r1, #255
+; ARM: uxtb r1, r1
; ARM: bl {{_?}}memset
; ARM-LONG: t1
; ARM-LONG: {{(movw r3, :lower16:L_memset\$non_lazy_ptr)|(ldr r3, .LCPI)}}
@@ -34,7 +34,7 @@ define void @t1() nounwind ssp {
; THUMB: movt r1, #0
; THUMB: movs r2, #10
; THUMB: movt r2, #0
-; THUMB: and r1, r1, #255
+; THUMB: uxtb r1, r1
; THUMB: bl {{_?}}memset
; THUMB-LONG: t1
; THUMB-LONG: {{(movw r0, :lower16:_?message1)|(ldr.n r0, .LCPI)}}
diff --git a/test/CodeGen/ARM/fast-isel-ret.ll b/test/CodeGen/ARM/fast-isel-ret.ll
index ba5412c4f1..a7d271a94c 100644
--- a/test/CodeGen/ARM/fast-isel-ret.ll
+++ b/test/CodeGen/ARM/fast-isel-ret.ll
@@ -27,7 +27,7 @@ entry:
define zeroext i8 @ret3(i8 signext %a) nounwind uwtable ssp {
entry:
; CHECK: ret3
-; CHECK: and r0, r0, #255
+; CHECK: uxtb r0, r0
; CHECK: bx lr
ret i8 %a
}
diff --git a/test/CodeGen/ARM/fast-isel.ll b/test/CodeGen/ARM/fast-isel.ll
index f877e78c6e..c4274c5eb5 100644
--- a/test/CodeGen/ARM/fast-isel.ll
+++ b/test/CodeGen/ARM/fast-isel.ll
@@ -80,12 +80,12 @@ bb1:
; THUMB: and
; THUMB: strb
-; THUMB: and{{.*}}, #255
+; THUMB: uxtb
; THUMB: strh
; THUMB: uxth
; ARM: and
; ARM: strb
-; ARM: and{{.*}}, #255
+; ARM: uxtb
; ARM: strh
; ARM: uxth
@@ -121,13 +121,13 @@ bb3:
; THUMB: ldrb
; THUMB: ldrh
-; THUMB: and{{.*}}, #255
+; THUMB: uxtb
; THUMB: sxth
; THUMB: add
; THUMB: sub
; ARM: ldrb
; ARM: ldrh
-; ARM: and{{.*}}, #255
+; ARM: uxtb
; ARM: sxth
; ARM: add
; ARM: sub