From 02ebd977bdd8e385bb3c86119460290172d6639a Mon Sep 17 00:00:00 2001
From: chengbin <bin.cheng@linux.alibaba.com>
Date: Thu, 13 Dec 2018 10:45:36 +0800
Subject: [PATCH 4/7] Don't generate histogram value for internal call in
 autofdo.

---
 gcc/auto-profile.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/auto-profile.c b/gcc/auto-profile.c
index 7e0020bc232..f51a4bf4ce1 100644
--- a/gcc/auto-profile.c
+++ b/gcc/auto-profile.c
@@ -987,7 +987,9 @@ afdo_indirect_call (gimple_stmt_iterator *gsi, const icall_target_map &map,
   if (map.size () == 0)
     return;
   gcall *stmt = dyn_cast <gcall *> (gs);
-  if ((!stmt) || gimple_call_fndecl (stmt) != NULL_TREE)
+  if (!stmt
+      || gimple_call_internal_p (stmt)
+      || gimple_call_fndecl (stmt) != NULL_TREE)
     return;
 
   callee = gimple_call_fn (stmt);
-- 
2.14.4.44.g2045bb6

