xref: /aosp_15_r20/external/llvm/test/CodeGen/ARM/thumb1-ldst-opt.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -stop-after block-placement -o - %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Workertarget triple = "thumbv6m-none-none"
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Workerdefine i32* @foo(i32* readonly %p0) {
6*9880d681SAndroid Build Coastguard Workerentry:
7*9880d681SAndroid Build Coastguard Worker  %add.ptr = getelementptr inbounds i32, i32* %p0, i32 10
8*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr inbounds i32, i32* %p0, i32 13
9*9880d681SAndroid Build Coastguard Worker  %0 = load i32, i32* %arrayidx, align 4
10*9880d681SAndroid Build Coastguard Worker  %arrayidx1 = getelementptr inbounds i32, i32* %p0, i32 12
11*9880d681SAndroid Build Coastguard Worker  %1 = load i32, i32* %arrayidx1, align 4
12*9880d681SAndroid Build Coastguard Worker  %add = add nsw i32 %1, %0
13*9880d681SAndroid Build Coastguard Worker  %arrayidx2 = getelementptr inbounds i32, i32* %p0, i32 11
14*9880d681SAndroid Build Coastguard Worker  %2 = load i32, i32* %arrayidx2, align 4
15*9880d681SAndroid Build Coastguard Worker  %add3 = add nsw i32 %add, %2
16*9880d681SAndroid Build Coastguard Worker  %3 = load i32, i32* %add.ptr, align 4
17*9880d681SAndroid Build Coastguard Worker  %add5 = add nsw i32 %add3, %3
18*9880d681SAndroid Build Coastguard Worker  tail call void @g(i32 %add5)
19*9880d681SAndroid Build Coastguard Worker  ret i32* %p0
20*9880d681SAndroid Build Coastguard Worker}
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Workerdeclare void @g(i32)
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: name: foo
25*9880d681SAndroid Build Coastguard Worker; CHECK: [[BASE:%r[0-7]]], {{.*}} tADDi8
26*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: [[BASE]] = tLDMIA_UPD {{.*}} [[BASE]]
27*9880d681SAndroid Build Coastguard Worker; CHECK: tLDMIA killed [[BASE]], {{.*}} def [[BASE]]
28