brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · a0fc346 Raw
47 lines · plain
1; RUN: opt -S -passes=mergefunc < %s | FileCheck %s2 3%Opaque_type = type opaque4%S2i = type <{ i64, i64 }>5%D2i = type <{ i64, i64 }>6%Di = type <{ i32 }>7%Si = type <{ i32 }>8 9define void @B(ptr sret(%Opaque_type) %a, ptr %b, ptr %xp, ptr %yp) {10  %x = load i32, ptr %xp11  %y = load i32, ptr %yp12  %sum = add i32 %x, %y13  %sum2 = add i32 %sum, %y14  %sum3 = add i32 %sum2, %y15  ret void16}17 18define void @C(ptr sret(%Opaque_type) %a, ptr %b, ptr %xp, ptr %yp) {19  %x = load i32, ptr %xp20  %y = load i32, ptr %yp21  %sum = add i32 %x, %y22  %sum2 = add i32 %sum, %y23  %sum3 = add i32 %sum2, %y24  ret void25}26 27define void @A(ptr sret(%Opaque_type) %a, ptr %b, ptr %xp, ptr %yp) {28  %x = load i32, ptr %xp29  %y = load i32, ptr %yp30  %sum = add i32 %x, %y31  %sum2 = add i32 %sum, %y32  %sum3 = add i32 %sum2, %y33  ret void34}35 36; Make sure we transfer the parameter attributes to the call site.37; CHECK-LABEL: define void @C(ptr sret38; CHECK:  tail call void @A(ptr sret(%Opaque_type) %0, ptr %1, ptr %2, ptr %3)39; CHECK:  ret void40 41 42; Make sure we transfer the parameter attributes to the call site.43; CHECK-LABEL: define void @B(ptr sret44; CHECK:  tail call void @A(ptr sret(%Opaque_type) %0, ptr %1, ptr %2, ptr %3)45; CHECK:  ret void46 47