diff options
author | dim <dim@FreeBSD.org> | 2013-04-08 18:41:23 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-04-08 18:41:23 +0000 |
commit | 169d2bd06003c39970bc94c99669a34b61bb7e45 (patch) | |
tree | 06099edc18d30894081a822b756f117cbe0b8207 /test/CodeGen/ARM/machine-cse-cmp.ll | |
parent | 0ac5f94c68a3d8fbd1380dbba26d891ea7816b5e (diff) | |
download | FreeBSD-src-169d2bd06003c39970bc94c99669a34b61bb7e45.zip FreeBSD-src-169d2bd06003c39970bc94c99669a34b61bb7e45.tar.gz |
Vendor import of llvm trunk r178860:
http://llvm.org/svn/llvm-project/llvm/trunk@178860
Diffstat (limited to 'test/CodeGen/ARM/machine-cse-cmp.ll')
-rw-r--r-- | test/CodeGen/ARM/machine-cse-cmp.ll | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/machine-cse-cmp.ll b/test/CodeGen/ARM/machine-cse-cmp.ll index 3ac7d77..03abd76 100644 --- a/test/CodeGen/ARM/machine-cse-cmp.ll +++ b/test/CodeGen/ARM/machine-cse-cmp.ll @@ -45,3 +45,35 @@ for.cond1.preheader: ; preds = %entry } declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind + +; rdar://12462006 +define i8* @f3(i8* %base, i32* nocapture %offset, i32 %size) nounwind { +entry: +; CHECK: f3: +; CHECK-NOT: sub +; CHECK: cmp +; CHECK: blt +%0 = load i32* %offset, align 4 +%cmp = icmp slt i32 %0, %size +%s = sub nsw i32 %0, %size +%size2 = sub nsw i32 %size, 0 +br i1 %cmp, label %return, label %if.end + +if.end: +; We are checking cse between %sub here and %s in entry block. +%sub = sub nsw i32 %0, %size2 +%s2 = sub nsw i32 %s, %size +%s3 = sub nsw i32 %sub, %s2 +; CHECK: sub [[R1:r[0-9]+]], [[R2:r[0-9]+]], r2 +; CHECK: sub [[R3:r[0-9]+]], [[R1]], r2 +; CHECK: sub [[R4:r[0-9]+]], [[R1]], [[R3]] +; CHECK-NOT: sub +; CHECK: str +store i32 %s3, i32* %offset, align 4 +%add.ptr = getelementptr inbounds i8* %base, i32 %sub +br label %return + +return: +%retval.0 = phi i8* [ %add.ptr, %if.end ], [ null, %entry ] +ret i8* %retval.0 +} |