1 ; RUN: llc -mtriple=arm %s -o - | FileCheck %s
2 ; RUN: llc -mtriple=thumbv7 %s -o - | FileCheck %s
4 ; We ended up feeding a deleted node back to TableGen when we converted "Off *
5 ; 410" into "(Off * 205) << 1", where the multiplication already existed in the
8 ; CHECK-LABEL: addrmode_cse_mutation:
9 ; CHECK: {{mul|muls}} [[OFFSET:r[0-9]+]], {{r[0-9]+}}, {{r[0-9]+}}
10 ; CHECK: {{ldrb|ldrb.w}} {{r[0-9]+}}, [r0, [[OFFSET]], lsl #3]
11 define i32 @addrmode_cse_mutation(ptr %base, i32 %count) {
12 %offset = mul i32 %count, 277288
13 %ptr = getelementptr i8, ptr %base, i32 %offset
14 %val = load volatile i8, ptr %ptr
15 %res = mul i32 %count, 34661
19 ; CHECK-LABEL: addrmode_cse_multi_use:
20 ; CHECK-NOT: {{ldrb|ldrb.w}} {{r[0-9]+}}, [{{r[0-9]+}}, {{r[0-9]+}}, lsl #3]
21 define i32 @addrmode_cse_multi_use(ptr %base, i32 %count) {
22 %offset = mul i32 %count, 277288
23 %ptr = getelementptr i8, ptr %base, i32 %offset
24 %val = load volatile i8, ptr %ptr
25 %res = mul i32 %count, 34661
26 %res.1 = add i32 %res, %offset