aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/ARM/2013-05-05-IfConvertBug.ll
diff options
context:
space:
mode:
authorJoey Gouly <joey.gouly@arm.com>2013-09-09 14:21:49 +0000
committerJoey Gouly <joey.gouly@arm.com>2013-09-09 14:21:49 +0000
commitb57d99694b87326a2eea26d76becf67bf5784b49 (patch)
tree9cec38b5b6631727d01203aa4743d43d8024603b /test/CodeGen/ARM/2013-05-05-IfConvertBug.ll
parent7b80d9233a0a69c47d1e5ebe647951349ed166e8 (diff)
downloadexternal_llvm-b57d99694b87326a2eea26d76becf67bf5784b49.tar.gz
external_llvm-b57d99694b87326a2eea26d76becf67bf5784b49.tar.bz2
external_llvm-b57d99694b87326a2eea26d76becf67bf5784b49.zip
[ARMv8] Prevent generation of deprecated IT blocks on ARMv8 in Thumb mode.
IT blocks can only be one instruction lonf, and can only contain a subset of the 16 instructions. Patch by Artyom Skrobov! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190309 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM/2013-05-05-IfConvertBug.ll')
-rw-r--r--test/CodeGen/ARM/2013-05-05-IfConvertBug.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/2013-05-05-IfConvertBug.ll b/test/CodeGen/ARM/2013-05-05-IfConvertBug.ll
index 2eeebac993..8bc8cb1d89 100644
--- a/test/CodeGen/ARM/2013-05-05-IfConvertBug.ll
+++ b/test/CodeGen/ARM/2013-05-05-IfConvertBug.ll
@@ -1,4 +1,5 @@
; RUN: llc < %s -mtriple=thumbv7-apple-ios -mcpu=cortex-a8 | FileCheck %s
+; RUN: llc < %s -mtriple=thumbv8 | FileCheck -check-prefix=CHECK-V8 %s
; rdar://13782395
define i32 @t1(i32 %a, i32 %b, i8** %retaddr) {
@@ -100,6 +101,27 @@ KBBlockZero.exit: ; preds = %bb2.i
; CHECK: [[LABEL]]:
; CHECK-NEXT: subs r0, r1, r0
; CHECK-NEXT: bx lr
+
+; CHECK-V8-LABEL: wrapDistance:
+; CHECK-V8: cmp r1, #59
+; CHECK-V8-NEXT: bgt
+; CHECK-V8-NEXT: %if.then
+; CHECK-V8-NEXT: subs r0, r2, #1
+; CHECK-V8-NEXT: bx lr
+; CHECK-V8-NEXT: %if.else
+; CHECK-V8-NEXT: subs [[REG:r[0-9]+]], #120
+; CHECK-V8-NEXT: cmp [[REG]], r1
+; CHECK-V8-NEXT: bge
+; CHECK-V8-NEXT: %if.else
+; CHECK-V8-NEXT: cmp r0, #119
+; CHECK-V8-NEXT: bgt
+; CHECK-V8-NEXT: %if.then4
+; CHECK-V8-NEXT: adds r0, r1, #1
+; CHECK-V8-NEXT: bx lr
+; CHECK-V8-NEXT: %if.end5
+; CHECK-V8-NEXT: subs r0, r1, r0
+; CHECK-V8-NEXT: bx lr
+
define i32 @wrapDistance(i32 %tx, i32 %sx, i32 %w) {
entry:
%cmp = icmp slt i32 %sx, 60