summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2016-07-26 20:23:26 +0000
committerTim Northover <tnorthover@apple.com>2016-07-26 20:23:26 +0000
commitad2b717f2c8fcc279cf13aa51349012c3710c987 (patch)
treebd3e80030a58bc7921257a8ed21a775871c24d20 /llvm/test
parent2dc08f7df8b8edaf60df784996e2224786b3115c (diff)
downloadbcm5719-llvm-ad2b717f2c8fcc279cf13aa51349012c3710c987.tar.gz
bcm5719-llvm-ad2b717f2c8fcc279cf13aa51349012c3710c987.zip
GlobalISel: add generic load and store instructions.
Pretty straightforward, the only oddity is the MachineMemOperand (which it's surprisingly difficult to share code for). llvm-svn: 276799
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll30
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll b/llvm/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll
index 2ea360cf0be..ac2e744426b 100644
--- a/llvm/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll
+++ b/llvm/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll
@@ -165,3 +165,33 @@ define i64 @bitcast(i64 %a) {
%res2 = bitcast <2 x i32> %res1 to i64
ret i64 %res2
}
+
+; CHECK-LABEL: name: load
+; CHECK: [[ADDR:%[0-9]+]](64) = COPY %x0
+; CHECK: [[ADDR42:%[0-9]+]](64) = COPY %x1
+; CHECK: [[VAL1:%[0-9]+]](64) = G_LOAD { s64, p0 } [[ADDR]] :: (load 8 from %ir.addr, align 16)
+; CHECK: [[VAL2:%[0-9]+]](64) = G_LOAD { s64, p42 } [[ADDR42]] :: (load 8 from %ir.addr42)
+; CHECK: [[SUM:%.*]](64) = G_ADD s64 [[VAL1]], [[VAL2]]
+; CHECK: %x0 = COPY [[SUM]]
+; CHECK: RET_ReallyLR implicit %x0
+define i64 @load(i64* %addr, i64 addrspace(42)* %addr42) {
+ %val1 = load i64, i64* %addr, align 16
+ %val2 = load i64, i64 addrspace(42)* %addr42
+ %sum = add i64 %val1, %val2
+ ret i64 %sum
+}
+
+; CHECK-LABEL: name: store
+; CHECK: [[ADDR:%[0-9]+]](64) = COPY %x0
+; CHECK: [[ADDR42:%[0-9]+]](64) = COPY %x1
+; CHECK: [[VAL1:%[0-9]+]](64) = COPY %x2
+; CHECK: [[VAL2:%[0-9]+]](64) = COPY %x3
+; CHECK: G_STORE { s64, p0 } [[VAL1]], [[ADDR]] :: (store 8 into %ir.addr, align 16)
+; CHECK: G_STORE { s64, p42 } [[VAL2]], [[ADDR42]] :: (store 8 into %ir.addr42)
+; CHECK: RET_ReallyLR
+define void @store(i64* %addr, i64 addrspace(42)* %addr42, i64 %val1, i64 %val2) {
+ store i64 %val1, i64* %addr, align 16
+ store i64 %val2, i64 addrspace(42)* %addr42
+ %sum = add i64 %val1, %val2
+ ret void
+}
OpenPOWER on IntegriCloud