summaryrefslogtreecommitdiffstats
path: root/test/CodeGen
diff options
context:
space:
mode:
authorTom Stellard <tstellar@redhat.com>2017-11-28 22:02:15 +0000
committerTom Stellard <tstellar@redhat.com>2017-11-28 22:02:15 +0000
commit9bc5c8821866ecc04eda587de23dd4b009760265 (patch)
tree051e620264b40a7fb76bd30ca825d53571e856cc /test/CodeGen
parent3e430490419645a35399e7937d96482681984e47 (diff)
Merging r316035:
------------------------------------------------------------------------ r316035 | tnorthover | 2017-10-17 14:43:52 -0700 (Tue, 17 Oct 2017) | 6 lines AArch64: account for possible frame index operand in compares. If the address of a local is used in a comparison, AArch64 can fold the address-calculation into the comparison via "adds". Unfortunately, a couple of places (both hit in this one test) are not ready to deal with that yet and just assume the first source operand is a register. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_50@319231 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/AArch64/cmp-frameindex.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/CodeGen/AArch64/cmp-frameindex.ll b/test/CodeGen/AArch64/cmp-frameindex.ll
new file mode 100644
index 000000000000..2d01b76e186c
--- /dev/null
+++ b/test/CodeGen/AArch64/cmp-frameindex.ll
@@ -0,0 +1,19 @@
+; RUN: llc -mtriple=aarch64 %s -o - | FileCheck %s
+
+; CHECK: test_frameindex_cmp:
+; CHECK: cmn sp, #{{[0-9]+}}
+define void @test_frameindex_cmp() {
+ %stack = alloca i8
+ %stack.int = ptrtoint i8* %stack to i64
+ %cmp = icmp ne i64 %stack.int, 0
+ br i1 %cmp, label %bb1, label %bb2
+
+bb1:
+ call void @bar()
+ ret void
+
+bb2:
+ ret void
+}
+
+declare void @bar()