1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00
Dehao Chen 42ca2b084a Set the prof weight correctly for call instructions in DeadArgumentElimination.
Summary: In DeadArgumentElimination, the call instructions will be replaced. We also need to set the prof weights so that function inlining can find the correct profile.

Reviewers: eraman

Reviewed By: eraman

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31143

llvm-svn: 298660
2017-03-23 23:26:00 +00:00

23 lines
532 B
LLVM

; RUN: opt -deadargelim -S < %s | FileCheck %s
; Checks if !prof metadata is corret in deadargelim.
define void @caller() #0 {
; CHECK: call void @test_vararg(), !prof ![[PROF:[0-9]]]
; CHECK: call void @test(), !prof ![[PROF]]
call void (i32, ...) @test_vararg(i32 1), !prof !0
call void @test(i32 1), !prof !0
ret void
}
define internal void @test_vararg(i32, ...) #1 {
ret void
}
define internal void @test(i32 %a) #1 {
ret void
}
; CHECK:![[PROF]] = !{!"branch_weights", i32 30}
!0 = !{!"branch_weights", i32 30}