xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/lsr-static-addr.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=x86-64 -mcpu=generic -mtriple=x86_64-unknown-linux-gnu -relocation-model=static -asm-verbose=false < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=x86-64 -mcpu=atom -mtriple=x86_64-unknown-linux-gnu -relocation-model=static -asm-verbose=false < %s | FileCheck -check-prefix=ATOM %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; CHECK: xorl  %eax, %eax
5*9880d681SAndroid Build Coastguard Worker; CHECK: movsd .LCPI0_0(%rip), %xmm0
6*9880d681SAndroid Build Coastguard Worker; CHECK: align
7*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: BB0_2:
8*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: movsd A(,%rax,8)
9*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: mulsd
10*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: movsd
11*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: incq %rax
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Worker; ATOM: movsd .LCPI0_0(%rip), %xmm0
15*9880d681SAndroid Build Coastguard Worker; ATOM: xorl  %eax, %eax
16*9880d681SAndroid Build Coastguard Worker; ATOM: align
17*9880d681SAndroid Build Coastguard Worker; ATOM-NEXT: BB0_2:
18*9880d681SAndroid Build Coastguard Worker; ATOM-NEXT: movsd A(,%rax,8)
19*9880d681SAndroid Build Coastguard Worker; ATOM-NEXT: mulsd
20*9880d681SAndroid Build Coastguard Worker; ATOM-NEXT: movsd
21*9880d681SAndroid Build Coastguard Worker; ATOM-NEXT: incq %rax
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Worker@A = external global [0 x double]
24*9880d681SAndroid Build Coastguard Worker
25*9880d681SAndroid Build Coastguard Workerdefine void @foo(i64 %n) nounwind {
26*9880d681SAndroid Build Coastguard Workerentry:
27*9880d681SAndroid Build Coastguard Worker  %cmp5 = icmp sgt i64 %n, 0
28*9880d681SAndroid Build Coastguard Worker  br i1 %cmp5, label %for.body, label %for.end
29*9880d681SAndroid Build Coastguard Worker
30*9880d681SAndroid Build Coastguard Workerfor.body:
31*9880d681SAndroid Build Coastguard Worker  %i.06 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
32*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr [0 x double], [0 x double]* @A, i64 0, i64 %i.06
33*9880d681SAndroid Build Coastguard Worker  %tmp3 = load double, double* %arrayidx, align 8
34*9880d681SAndroid Build Coastguard Worker  %mul = fmul double %tmp3, 2.300000e+00
35*9880d681SAndroid Build Coastguard Worker  store double %mul, double* %arrayidx, align 8
36*9880d681SAndroid Build Coastguard Worker  %inc = add nsw i64 %i.06, 1
37*9880d681SAndroid Build Coastguard Worker  %exitcond = icmp eq i64 %inc, %n
38*9880d681SAndroid Build Coastguard Worker  br i1 %exitcond, label %for.end, label %for.body
39*9880d681SAndroid Build Coastguard Worker
40*9880d681SAndroid Build Coastguard Workerfor.end:
41*9880d681SAndroid Build Coastguard Worker  ret void
42*9880d681SAndroid Build Coastguard Worker}
43