MergeFuncs: Transfer the function parameter attributes to the call site

rdar://21516488

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242558 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Arnold Schwaighofer
2015-07-17 18:59:08 +00:00
parent 6624afccc6
commit beda80e3bb
4 changed files with 25 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
; RUN: opt -S -mergefunc < %s | FileCheck %s
%Si = type <{ i32 }>
define void @sum(%Si* noalias sret %a, i32 %x, i32 %y) {
%sum = add i32 %x, %y
%sum2 = add i32 %sum, %y
%sum3 = add i32 %sum2, %y
ret void
}
define void @add(%Si* noalias sret %a, i32 %x, i32 %y) {
%sum = add i32 %x, %y
%sum2 = add i32 %sum, %y
%sum3 = add i32 %sum2, %y
ret void
}
; Make sure we transfer the parameter attributes to the call site.
; CHECK-LABEL: define void @sum(%Si* noalias sret, i32, i32)
; CHECK: tail call void @add(%Si* noalias sret %{{.*}}, i32 %{{.*}}, i32 %{{.*}})
; CHECK: ret void