[WebAssembly] Don't perform the returned-argument optimization on constants.
[oota-llvm.git] / test / CodeGen / ARM / negative-offset.ll
1 ; RUN: llc -mtriple=arm-eabi -O3 %s -o - | FileCheck %s
2
3 ; Function Attrs: nounwind readonly
4 define arm_aapcscc i32 @sum(i32* nocapture readonly %p) #0 {
5 entry:
6 ;CHECK-LABEL: sum:
7 ;CHECK-NOT: sub
8 ;CHECK: ldr r{{.*}}, [r0, #-16]
9 ;CHECK: ldr r{{.*}}, [r0, #-8]
10   %arrayidx = getelementptr inbounds i32, i32* %p, i32 -4
11   %0 = load i32, i32* %arrayidx, align 4
12   %arrayidx1 = getelementptr inbounds i32, i32* %p, i32 -2
13   %1 = load i32, i32* %arrayidx1, align 4
14   %add = add nsw i32 %1, %0
15   ret i32 %add
16 }
17