[llvm-commits] [llvm] r152292 - /llvm/trunk/test/CodeGen/Mips/zeroreg.ll
Akira Hatanaka
ahatanaka at mips.com
Wed Mar 7 19:32:43 PST 2012
Author: ahatanak
Date: Wed Mar 7 21:32:42 2012
New Revision: 152292
URL: http://llvm.org/viewvc/llvm-project?rev=152292&view=rev
Log:
Test case for r152280, r152285 and r152290.
Added:
llvm/trunk/test/CodeGen/Mips/zeroreg.ll
Added: llvm/trunk/test/CodeGen/Mips/zeroreg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/zeroreg.ll?rev=152292&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Mips/zeroreg.ll (added)
+++ llvm/trunk/test/CodeGen/Mips/zeroreg.ll Wed Mar 7 21:32:42 2012
@@ -0,0 +1,27 @@
+; RUN: llc < %s -march=mipsel | FileCheck %s
+
+ at g1 = external global i32
+
+define i32 @foo0(i32 %s) nounwind readonly {
+entry:
+; CHECK-NOT: addiu
+; CHECK: movn
+ %tobool = icmp ne i32 %s, 0
+ %0 = load i32* @g1, align 4, !tbaa !0
+ %cond = select i1 %tobool, i32 0, i32 %0
+ ret i32 %cond
+}
+
+define i32 @foo1(i32 %s) nounwind readonly {
+entry:
+; CHECK-NOT: addiu
+; CHECK: movz
+ %tobool = icmp ne i32 %s, 0
+ %0 = load i32* @g1, align 4, !tbaa !0
+ %cond = select i1 %tobool, i32 %0, i32 0
+ ret i32 %cond
+}
+
+!0 = metadata !{metadata !"int", metadata !1}
+!1 = metadata !{metadata !"omnipotent char", metadata !2}
+!2 = metadata !{metadata !"Simple C/C++ TBAA", null}
More information about the llvm-commits
mailing list