xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/licm-regpressure.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; This tests currently fails as MachineLICM does not compute register pressure
3*9880d681SAndroid Build Coastguard Worker; correctly. More details: llvm.org/PR23143
4*9880d681SAndroid Build Coastguard Worker; XFAIL: *
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker; MachineLICM should take register pressure into account.
7*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: Spill
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker%struct.A = type { i32, i32, i32, i32, i32, i32, i32 }
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Workerdefine void @test(i1 %b, %struct.A* %a) nounwind {
12*9880d681SAndroid Build Coastguard Workerentry:
13*9880d681SAndroid Build Coastguard Worker  br label %loop-header
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Workerloop-header:
16*9880d681SAndroid Build Coastguard Worker  br label %loop-body
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Workerloop-body:
19*9880d681SAndroid Build Coastguard Worker  %0 = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 0
20*9880d681SAndroid Build Coastguard Worker  %1 = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 1
21*9880d681SAndroid Build Coastguard Worker  %2 = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 2
22*9880d681SAndroid Build Coastguard Worker  %3 = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 3
23*9880d681SAndroid Build Coastguard Worker  %4 = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 4
24*9880d681SAndroid Build Coastguard Worker  %5 = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 5
25*9880d681SAndroid Build Coastguard Worker  %6 = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 6
26*9880d681SAndroid Build Coastguard Worker  call void @assign(i32* %0)
27*9880d681SAndroid Build Coastguard Worker  call void @assign(i32* %1)
28*9880d681SAndroid Build Coastguard Worker  call void @assign(i32* %2)
29*9880d681SAndroid Build Coastguard Worker  call void @assign(i32* %3)
30*9880d681SAndroid Build Coastguard Worker  call void @assign(i32* %4)
31*9880d681SAndroid Build Coastguard Worker  call void @assign(i32* %5)
32*9880d681SAndroid Build Coastguard Worker  call void @assign(i32* %6)
33*9880d681SAndroid Build Coastguard Worker  br i1 %b, label %loop-body, label %loop-exit
34*9880d681SAndroid Build Coastguard Worker
35*9880d681SAndroid Build Coastguard Workerloop-exit:
36*9880d681SAndroid Build Coastguard Worker  ret void
37*9880d681SAndroid Build Coastguard Worker}
38*9880d681SAndroid Build Coastguard Worker
39*9880d681SAndroid Build Coastguard Workerdeclare void @assign(i32*)
40