summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/Mips
diff options
context:
space:
mode:
authorKyle Butt <kyle+llvm@iteratee.net>2017-01-10 23:04:30 +0000
committerKyle Butt <kyle+llvm@iteratee.net>2017-01-10 23:04:30 +0000
commitdf27aa8c89ce96f7b01a0919697b0ea1505c01f3 (patch)
tree151faba3e276de822dbdf68c5e5b8e145afe2ed6 /llvm/test/CodeGen/Mips
parent623270694bbdfb598d4063d0f8237c0c5d4f37ef (diff)
downloadbcm5719-llvm-df27aa8c89ce96f7b01a0919697b0ea1505c01f3.tar.gz
bcm5719-llvm-df27aa8c89ce96f7b01a0919697b0ea1505c01f3.zip
CodeGen: Allow small copyable blocks to "break" the CFG.
When choosing the best successor for a block, ordinarily we would have preferred a block that preserves the CFG unless there is a strong probability the other direction. For small blocks that can be duplicated we now skip that requirement as well. Differential revision: https://reviews.llvm.org/D27742 llvm-svn: 291609
Diffstat (limited to 'llvm/test/CodeGen/Mips')
-rw-r--r--llvm/test/CodeGen/Mips/brconeq.ll4
-rw-r--r--llvm/test/CodeGen/Mips/brconeqk.ll4
-rw-r--r--llvm/test/CodeGen/Mips/brcongt.ll4
-rw-r--r--llvm/test/CodeGen/Mips/brconlt.ll4
-rw-r--r--llvm/test/CodeGen/Mips/brconnez.ll4
-rw-r--r--llvm/test/CodeGen/Mips/llvm-ir/ashr.ll14
-rw-r--r--llvm/test/CodeGen/Mips/micromips-compact-branches.ll3
7 files changed, 20 insertions, 17 deletions
diff --git a/llvm/test/CodeGen/Mips/brconeq.ll b/llvm/test/CodeGen/Mips/brconeq.ll
index 7c3c31e0ec3..40c281e758a 100644
--- a/llvm/test/CodeGen/Mips/brconeq.ll
+++ b/llvm/test/CodeGen/Mips/brconeq.ll
@@ -8,11 +8,11 @@ define void @test() nounwind {
entry:
%0 = load i32, i32* @i, align 4
%1 = load i32, i32* @j, align 4
- %cmp = icmp eq i32 %0, %1
+ %cmp = icmp ne i32 %0, %1
; 16: cmp ${{[0-9]+}}, ${{[0-9]+}}
; 16: bteqz $[[LABEL:[0-9A-Ba-b_]+]]
; 16: $[[LABEL]]:
- br i1 %cmp, label %if.end, label %if.then
+ br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 1, i32* @result, align 4
diff --git a/llvm/test/CodeGen/Mips/brconeqk.ll b/llvm/test/CodeGen/Mips/brconeqk.ll
index 85d257e8d79..b541554d548 100644
--- a/llvm/test/CodeGen/Mips/brconeqk.ll
+++ b/llvm/test/CodeGen/Mips/brconeqk.ll
@@ -6,8 +6,8 @@
define void @test() nounwind {
entry:
%0 = load i32, i32* @i, align 4
- %cmp = icmp eq i32 %0, 10
- br i1 %cmp, label %if.end, label %if.then
+ %cmp = icmp ne i32 %0, 10
+ br i1 %cmp, label %if.then, label %if.end
; 16: cmpi ${{[0-9]+}}, {{[0-9]+}}
; 16: bteqz $[[LABEL:[0-9A-Ba-b_]+]]
; 16: $[[LABEL]]:
diff --git a/llvm/test/CodeGen/Mips/brcongt.ll b/llvm/test/CodeGen/Mips/brcongt.ll
index 7dffdb41121..d4d81751846 100644
--- a/llvm/test/CodeGen/Mips/brcongt.ll
+++ b/llvm/test/CodeGen/Mips/brcongt.ll
@@ -9,8 +9,8 @@ define void @test() nounwind {
entry:
%0 = load i32, i32* @i, align 4
%1 = load i32, i32* @j, align 4
- %cmp = icmp sgt i32 %0, %1
- br i1 %cmp, label %if.end, label %if.then
+ %cmp = icmp sle i32 %0, %1
+ br i1 %cmp, label %if.then, label %if.end
; 16: slt ${{[0-9]+}}, ${{[0-9]+}}
; 16: btnez $[[LABEL:[0-9A-Ba-b_]+]]
; 16: $[[LABEL]]:
diff --git a/llvm/test/CodeGen/Mips/brconlt.ll b/llvm/test/CodeGen/Mips/brconlt.ll
index 65f6c347b67..9a69b8c93ca 100644
--- a/llvm/test/CodeGen/Mips/brconlt.ll
+++ b/llvm/test/CodeGen/Mips/brconlt.ll
@@ -10,8 +10,8 @@ define void @test() nounwind {
entry:
%0 = load i32, i32* @j, align 4
%1 = load i32, i32* @i, align 4
- %cmp = icmp slt i32 %0, %1
- br i1 %cmp, label %if.end, label %if.then
+ %cmp = icmp sge i32 %0, %1
+ br i1 %cmp, label %if.then, label %if.end
; 16: slt ${{[0-9]+}}, ${{[0-9]+}}
; MM32R6: slt ${{[0-9]+}}, ${{[0-9]+}}
diff --git a/llvm/test/CodeGen/Mips/brconnez.ll b/llvm/test/CodeGen/Mips/brconnez.ll
index 27cf9e8cacb..eafddccdd4c 100644
--- a/llvm/test/CodeGen/Mips/brconnez.ll
+++ b/llvm/test/CodeGen/Mips/brconnez.ll
@@ -7,7 +7,7 @@ define void @test() nounwind {
entry:
%0 = load i32, i32* @j, align 4
%cmp = icmp eq i32 %0, 0
- br i1 %cmp, label %if.then, label %if.end
+ br i1 %cmp, label %if.then, label %if.end, !prof !1
; 16: bnez ${{[0-9]+}}, $[[LABEL:[0-9A-Ba-b_]+]]
; 16: lw ${{[0-9]+}}, %got(result)(${{[0-9]+}})
@@ -21,4 +21,4 @@ if.end: ; preds = %if.then, %entry
ret void
}
-
+!1 = !{!"branch_weights", i32 2, i32 1}
diff --git a/llvm/test/CodeGen/Mips/llvm-ir/ashr.ll b/llvm/test/CodeGen/Mips/llvm-ir/ashr.ll
index c8d0e76f94e..5b39ba408a0 100644
--- a/llvm/test/CodeGen/Mips/llvm-ir/ashr.ll
+++ b/llvm/test/CodeGen/Mips/llvm-ir/ashr.ll
@@ -91,12 +91,13 @@ entry:
; M2: sllv $[[T5:[0-9]+]], $[[T4]], $[[T3]]
; M2: or $3, $[[T3]], $[[T2]]
; M2: $[[BB0]]:
- ; M2: beqz $[[T1]], $[[BB1:BB[0-9_]+]]
+ ; M2: bnez $[[T1]], $[[BB1:BB[0-9_]+]]
; M2: nop
- ; M2: sra $2, $4, 31
- ; M2: $[[BB1]]:
; M2: jr $ra
; M2: nop
+ ; M2: $[[BB1]]:
+ ; M2: jr $ra
+ ; M2: sra $2, $4, 31
; 32R1-R5: srlv $[[T0:[0-9]+]], $5, $7
; 32R1-R5: not $[[T1:[0-9]+]], $7
@@ -177,12 +178,13 @@ entry:
; M3: dsllv $[[T7:[0-9]+]], $[[T5]], $[[T6]]
; M3: or $3, $[[T7]], $[[T4]]
; M3: [[BB0]]:
- ; M3: beqz $[[T3]], [[BB1:.LBB[0-9_]+]]
+ ; M3: bnez $[[T3]], [[BB1:.LBB[0-9_]+]]
; M3: nop
- ; M3: dsra $2, $4, 63
- ; M3: [[BB1]]:
; M3: jr $ra
; M3: nop
+ ; M3: [[BB1]]:
+ ; M3: jr $ra
+ ; M3: dsra $2, $4, 63
; GP64-NOT-R6: dsrlv $[[T0:[0-9]+]], $5, $7
; GP64-NOT-R6: dsll $[[T1:[0-9]+]], $4, 1
diff --git a/llvm/test/CodeGen/Mips/micromips-compact-branches.ll b/llvm/test/CodeGen/Mips/micromips-compact-branches.ll
index c689944d386..332cd8cd105 100644
--- a/llvm/test/CodeGen/Mips/micromips-compact-branches.ll
+++ b/llvm/test/CodeGen/Mips/micromips-compact-branches.ll
@@ -6,7 +6,7 @@ entry:
%x = alloca i32, align 4
%0 = load i32, i32* %x, align 4
%cmp = icmp eq i32 %0, 0
- br i1 %cmp, label %if.then, label %if.end
+ br i1 %cmp, label %if.then, label %if.end, !prof !1
if.then:
store i32 10, i32* %x, align 4
@@ -17,3 +17,4 @@ if.end:
}
; CHECK: bnezc
+!1 = !{!"branch_weights", i32 2, i32 1}
OpenPOWER on IntegriCloud