summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2017-02-06 18:10:36 +0000
committerDehao Chen <dehao@google.com>2017-02-06 18:10:36 +0000
commitc81483d79cc0878e4dc03af564635daf9ee7e888 (patch)
tree3ab7b91b90d84c803773b9d4396ce5297d830093 /llvm/test
parent71cb164a563db8df011e24cde23dac7e0ccff099 (diff)
downloadbcm5719-llvm-c81483d79cc0878e4dc03af564635daf9ee7e888.tar.gz
bcm5719-llvm-c81483d79cc0878e4dc03af564635daf9ee7e888.zip
Fix the bug of samplepgo indirect call promption when type casting of the return value is needed.
Summary: When type casting of the return value is needed, promoteIndirectCall will return the type casting instruction instead of the direct call. This patch changed to return the direct call instruction instead. Reviewers: davidxl Reviewed By: davidxl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29569 llvm-svn: 294205
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/SampleProfile/indirect-call.ll16
1 files changed, 9 insertions, 7 deletions
diff --git a/llvm/test/Transforms/SampleProfile/indirect-call.ll b/llvm/test/Transforms/SampleProfile/indirect-call.ll
index 7e43adb905e..c868d0b83a2 100644
--- a/llvm/test/Transforms/SampleProfile/indirect-call.ll
+++ b/llvm/test/Transforms/SampleProfile/indirect-call.ll
@@ -12,16 +12,16 @@ define void @test(void ()*) !dbg !3 {
; CHECK-LABEL: @test_inline
; If the indirect call is promoted and inlined in profile, we should promote and inline it.
-define void @test_inline(void ()*) !dbg !3 {
- %2 = alloca void ()*
- store void ()* %0, void ()** %2
- %3 = load void ()*, void ()** %2
+define void @test_inline(i64* (i32*)*, i32* %x) !dbg !3 {
+ %2 = alloca i64* (i32*)*
+ store i64* (i32*)* %0, i64* (i32*)** %2
+ %3 = load i64* (i32*)*, i64* (i32*)** %2
; CHECK: icmp {{.*}} @foo_inline
; CHECK: if.true.direct_targ:
; CHECK-NOT: call
; CHECK: if.false.orig_indirect:
; CHECK: call
- call void %3(), !dbg !5
+ call i64* %3(i32* %x), !dbg !5
ret void
}
@@ -37,8 +37,10 @@ define void @test_noinline(void ()*) !dbg !3 {
ret void
}
-define void @foo_inline() !dbg !3 {
- ret void
+@x = global i32 0, align 4
+
+define i32* @foo_inline(i32* %x) !dbg !3 {
+ ret i32* %x
}
define i32 @foo_noinline(i32 %x) !dbg !3 {
OpenPOWER on IntegriCloud