40 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mcpu=btver2 %s -o - | FileCheck %s3; Test desc: two functions (foo, bar) with byval arguments, should not have4; reads/writes from/to byval storage re-ordered.5; When broken, five "1" constants are written into the byval %struct.face,6; but the subsequent byval read of that struct (call to bar) gets re-ordered7; before those writes, illegally.8source_filename = "test.c"9target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"10target triple = "x86_64-pc-linux-gnu"11 12%struct.face = type { [7 x i32] }13 14; Function Attrs: noinline nounwind uwtable15declare void @bar(ptr byval(%struct.face) nocapture readonly align 8);16 17; Function Attrs: noinline nounwind uwtable18define void @foo(ptr byval(%struct.face) nocapture align 8) local_unnamed_addr {19; CHECK-LABEL: foo:20; CHECK: # %bb.0:21; CHECK-NEXT: subq $40, %rsp22; CHECK-NEXT: .cfi_def_cfa_offset 4823; CHECK-NEXT: vmovaps {{.*#+}} xmm0 = [1,1,1,1]24; CHECK-NEXT: vmovaps %xmm0, {{[0-9]+}}(%rsp)25; CHECK-NEXT: movl $1, {{[0-9]+}}(%rsp)26; CHECK-NEXT: vmovups {{[0-9]+}}(%rsp), %xmm027; CHECK-NEXT: vmovups %xmm0, {{[0-9]+}}(%rsp)28; CHECK-NEXT: vmovaps {{[0-9]+}}(%rsp), %xmm029; CHECK-NEXT: vmovups %xmm0, (%rsp)30; CHECK-NEXT: callq bar@PLT31; CHECK-NEXT: addq $40, %rsp32; CHECK-NEXT: .cfi_def_cfa_offset 833; CHECK-NEXT: retq34 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %0, align 835 %2 = getelementptr inbounds %struct.face, ptr %0, i64 0, i32 0, i64 436 store i32 1, ptr %2, align 837 call void @bar(ptr byval(%struct.face) nonnull align 8 %0)38 ret void39}40