• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=i686-unknown -mcpu=pentium4 | FileCheck %s
3
4%struct.Foo = type { i32, %struct.Bar }
5%struct.Bar = type { i32, %struct.Buffer, i32 }
6%struct.Buffer = type { i8*, i32 }
7
8; This test checks that the load of store %2 is not dropped.
9;
10define i32 @pr34088() local_unnamed_addr {
11; CHECK-LABEL: pr34088:
12; CHECK:       # %bb.0: # %entry
13; CHECK-NEXT:    pushl %ebp
14; CHECK-NEXT:    .cfi_def_cfa_offset 8
15; CHECK-NEXT:    .cfi_offset %ebp, -8
16; CHECK-NEXT:    movl %esp, %ebp
17; CHECK-NEXT:    .cfi_def_cfa_register %ebp
18; CHECK-NEXT:    andl $-16, %esp
19; CHECK-NEXT:    subl $32, %esp
20; CHECK-NEXT:    xorps %xmm0, %xmm0
21; CHECK-NEXT:    movaps {{.*#+}} xmm1 = [205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205]
22; CHECK-NEXT:    xorl %eax, %eax
23; CHECK-NEXT:    movaps %xmm0, (%esp)
24; CHECK-NEXT:    movsd {{.*#+}} xmm0 = mem[0],zero
25; CHECK-NEXT:    movl $-842150451, {{[0-9]+}}(%esp) # imm = 0xCDCDCDCD
26; CHECK-NEXT:    movaps %xmm1, (%esp)
27; CHECK-NEXT:    movsd %xmm0, {{[0-9]+}}(%esp)
28; CHECK-NEXT:    movl %ebp, %esp
29; CHECK-NEXT:    popl %ebp
30; CHECK-NEXT:    .cfi_def_cfa %esp, 4
31; CHECK-NEXT:    retl
32entry:
33  %foo = alloca %struct.Foo, align 4
34  %0 = bitcast %struct.Foo* %foo to i8*
35  call void @llvm.memset.p0i8.i32(i8* align 4 nonnull %0, i8 0, i32 20, i1 false)
36  %buffer1 = getelementptr inbounds %struct.Foo, %struct.Foo* %foo, i32 0, i32 1, i32 1
37  %1 = bitcast %struct.Buffer* %buffer1 to i64*
38  %2 = load i64, i64* %1, align 4
39  call void @llvm.memset.p0i8.i32(i8* align 4 nonnull %0, i8 -51, i32 20, i1 false)
40  store i64 %2, i64* %1, align 4
41  ret i32 0
42}
43
44declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1)
45