xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/2010-06-25-CoalescerSubRegDefDead.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -O1 -mtriple=x86_64-unknown-linux-gnu -mcpu=core2 -relocation-model=pic -disable-fp-elim < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; <rdar://problem/8124405>
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker%struct.type = type { %struct.subtype*, i32, i8, i32, i8, i32, i32, i32, i32, i32, i8, i32, i32, i32, i32, i32, [256 x i32], i32, [257 x i32], [257 x i32], i32*, i16*, i8*, i32, i32, i32, i32, i32, [256 x i8], [16 x i8], [256 x i8], [4096 x i8], [16 x i32], [18002 x i8], [18002 x i8], [6 x [258 x i8]], [6 x [258 x i32]], [6 x [258 x i32]], [6 x [258 x i32]], [6 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32*, i32*, i32* }
5*9880d681SAndroid Build Coastguard Worker%struct.subtype = type { i8*, i32, i32, i32, i8*, i32, i32, i32, i8*, i8* (i8*, i32, i32)*, void (i8*, i8*)*, i8* }
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Workerdefine i32 @func(%struct.type* %s) nounwind optsize ssp {
8*9880d681SAndroid Build Coastguard Workerentry:
9*9880d681SAndroid Build Coastguard Worker  %tmp1 = getelementptr inbounds %struct.type, %struct.type* %s, i32 0, i32 1
10*9880d681SAndroid Build Coastguard Worker  %tmp2 = load i32, i32* %tmp1, align 8
11*9880d681SAndroid Build Coastguard Worker  %tmp3 = icmp eq i32 %tmp2, 10
12*9880d681SAndroid Build Coastguard Worker  %tmp4 = getelementptr inbounds %struct.type, %struct.type* %s, i32 0, i32 40
13*9880d681SAndroid Build Coastguard Worker  br i1 %tmp3, label %bb, label %entry.bb1_crit_edge
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Workerentry.bb1_crit_edge:
16*9880d681SAndroid Build Coastguard Worker  br label %bb1
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Workerbb:
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Worker; The point of this code is that %rdi is set to %rdi+64036 for the rep;stosl
21*9880d681SAndroid Build Coastguard Worker; statement. It can be an ADD or LEA instruction, it's not important which one
22*9880d681SAndroid Build Coastguard Worker; it is.
23*9880d681SAndroid Build Coastguard Worker;
24*9880d681SAndroid Build Coastguard Worker; CHECK: # %bb
25*9880d681SAndroid Build Coastguard Worker; CHECK: leaq	64036(%rdx), %rdi
26*9880d681SAndroid Build Coastguard Worker; CHECK: rep;stosl
27*9880d681SAndroid Build Coastguard Worker
28*9880d681SAndroid Build Coastguard Worker  %tmp5 = bitcast i32* %tmp4 to i8*
29*9880d681SAndroid Build Coastguard Worker  call void @llvm.memset.p0i8.i64(i8* %tmp5, i8 0, i64 84, i32 4, i1 false)
30*9880d681SAndroid Build Coastguard Worker  %tmp6 = getelementptr inbounds %struct.type, %struct.type* %s, i32 0, i32 62
31*9880d681SAndroid Build Coastguard Worker  store i32* null, i32** %tmp6, align 8
32*9880d681SAndroid Build Coastguard Worker  br label %bb1
33*9880d681SAndroid Build Coastguard Worker
34*9880d681SAndroid Build Coastguard Workerbb1:
35*9880d681SAndroid Build Coastguard Worker  store i32 10, i32* %tmp1, align 8
36*9880d681SAndroid Build Coastguard Worker  ret i32 42
37*9880d681SAndroid Build Coastguard Worker}
38*9880d681SAndroid Build Coastguard Worker
39*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind
40