summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorSimon Dardis <simon.dardis@imgtec.com>2016-08-16 17:16:11 +0000
committerSimon Dardis <simon.dardis@imgtec.com>2016-08-16 17:16:11 +0000
commit4893aff94ed2acbef2ff91592a423195baee47dc (patch)
tree24b3f674b643839964be3d097564e0859bd3fe19 /llvm/test
parenteabc0d0fd5fff7f2e6385b5b60d3fff5e9862b55 (diff)
downloadbcm5719-llvm-4893aff94ed2acbef2ff91592a423195baee47dc.tar.gz
bcm5719-llvm-4893aff94ed2acbef2ff91592a423195baee47dc.zip
[mips] Enforce compact branch restrictions
Check both operands for use of the $zero register which cannot be used with a compact branch instruction. Reviewers: dsanders, vkalintris Differential Review: https://reviews.llvm.org/D23547 llvm-svn: 278824
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/Mips/compactbranches/no-beqzc-bnezc.ll28
1 files changed, 28 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Mips/compactbranches/no-beqzc-bnezc.ll b/llvm/test/CodeGen/Mips/compactbranches/no-beqzc-bnezc.ll
index 969e3cbfb0f..7a9f287c1b4 100644
--- a/llvm/test/CodeGen/Mips/compactbranches/no-beqzc-bnezc.ll
+++ b/llvm/test/CodeGen/Mips/compactbranches/no-beqzc-bnezc.ll
@@ -100,3 +100,31 @@ define i64 @f5(i64 %a, i64 %b) {
if.end:
ret i64 0
}
+
+define i32 @f6(i32 %a) {
+; CHECK-LABEL: f6:
+; CHECK: beqzc ${{[0-9]+}}, $BB
+
+ %cmp = icmp eq i32 %a, 0
+ br i1 %cmp, label %if.then, label %if.end
+
+ if.then:
+ ret i32 1
+
+ if.end:
+ ret i32 0
+}
+
+define i32 @f7(i32 %a) {
+; CHECK-LABEL: f7:
+; CHECK: bnezc ${{[0-9]+}}, $BB
+
+ %cmp = icmp eq i32 0, %a
+ br i1 %cmp, label %if.then, label %if.end
+
+ if.then:
+ ret i32 1
+
+ if.end:
+ ret i32 0
+}
OpenPOWER on IntegriCloud