[llvm] r351102 - Ignore PhiNodes when mapping sample profile data

David Callahan via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 14 11:05:59 PST 2019


Author: david2050
Date: Mon Jan 14 11:05:59 2019
New Revision: 351102

URL: http://llvm.org/viewvc/llvm-project?rev=351102&view=rev
Log:
Ignore PhiNodes when mapping sample profile data

Summary: Like branch instructions, phi nodes frequently do not have debug information related to the block they are in and so they should be ignored.

Reviewers: danielcdh, twoh, Kader, wmi

Reviewed By: wmi

Subscribers: aprantl, llvm-commits

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

Modified:
    llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp

Modified: llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp?rev=351102&r1=351101&r2=351102&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp Mon Jan 14 11:05:59 2019
@@ -544,10 +544,10 @@ ErrorOr<uint64_t> SampleProfileLoader::g
   if (!FS)
     return std::error_code();
 
-  // Ignore all intrinsics and branch instructions.
-  // Branch instruction usually contains debug info from sources outside of
+  // Ignore all intrinsics, phinodes and branch instructions.
+  // Branch and phinodes instruction usually contains debug info from sources outside of
   // the residing basic block, thus we ignore them during annotation.
-  if (isa<BranchInst>(Inst) || isa<IntrinsicInst>(Inst))
+  if (isa<BranchInst>(Inst) || isa<IntrinsicInst>(Inst) || isa<PHINode>(Inst))
     return std::error_code();
 
   // If a direct call/invoke instruction is inlined in profile




More information about the llvm-commits mailing list