summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2017-05-03 16:54:30 +0000
committerTim Northover <tnorthover@apple.com>2017-05-03 16:54:30 +0000
commit761bcdaf066f55075989dac2dbf0ebb148198ee0 (patch)
tree873e746c03294621d022b814b223294f201482d4
parenta7cad4fcb7434e42d1387477c42a7546b9f27259 (diff)
downloadbcm5719-llvm-761bcdaf066f55075989dac2dbf0ebb148198ee0.tar.gz
bcm5719-llvm-761bcdaf066f55075989dac2dbf0ebb148198ee0.zip
ARM: add extra test for addrmode folding.
I was worried we might replace a mul with a mul+shift even if there were later uses. Turns out to be unfounded but I'd just as well add an actual test for it. llvm-svn: 302051
-rw-r--r--llvm/test/CodeGen/ARM/load-arm.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/load-arm.ll b/llvm/test/CodeGen/ARM/load-arm.ll
index 94ade49a121..3807424ece8 100644
--- a/llvm/test/CodeGen/ARM/load-arm.ll
+++ b/llvm/test/CodeGen/ARM/load-arm.ll
@@ -15,3 +15,14 @@ define i32 @addrmode_cse_mutation(i8* %base, i32 %count) {
%res = mul i32 %count, 34661
ret i32 %res
}
+
+; CHECK-LABEL: addrmode_cse_multi_use:
+; CHECK-NOT: {{ldrb|ldrb.w}} {{r[0-9]+}}, [{{r[0-9]+}}, {{r[0-9]+}}, lsl #3]
+define i32 @addrmode_cse_multi_use(i8* %base, i32 %count) {
+ %offset = mul i32 %count, 277288
+ %ptr = getelementptr i8, i8* %base, i32 %offset
+ %val = load volatile i8, i8* %ptr
+ %res = mul i32 %count, 34661
+ %res.1 = add i32 %res, %offset
+ ret i32 %res.1
+}
OpenPOWER on IntegriCloud