From 016d91ccbd4d434aa90fbfa6fd28e9da1abc9279 Mon Sep 17 00:00:00 2001 From: Djordje Todorovic Date: Thu, 27 Feb 2020 11:44:53 +0100 Subject: [CallSiteInfo] Handle bundles when updating call site info This will address the issue: P8198 and P8199 (from D73534). The methods was not handle bundles properly. Differential Revision: https://reviews.llvm.org/D74904 --- llvm/lib/CodeGen/MachineInstr.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/MachineInstr.cpp') diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index a704175a3db5..2eba41c9b906 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -697,8 +697,8 @@ void MachineInstr::eraseFromBundle() { getParent()->erase_instr(this); } -bool MachineInstr::isCandidateForCallSiteEntry() const { - if (!isCall(MachineInstr::IgnoreBundle)) +bool MachineInstr::isCandidateForCallSiteEntry(QueryType Type) const { + if (!isCall(Type)) return false; switch (getOpcode()) { case TargetOpcode::PATCHABLE_EVENT_CALL: @@ -711,6 +711,12 @@ bool MachineInstr::isCandidateForCallSiteEntry() const { return true; } +bool MachineInstr::shouldUpdateCallSiteInfo() const { + if (isBundle()) + return isCandidateForCallSiteEntry(MachineInstr::AnyInBundle); + return isCandidateForCallSiteEntry(); +} + unsigned MachineInstr::getNumExplicitOperands() const { unsigned NumOperands = MCID->getNumOperands(); if (!MCID->isVariadic()) -- cgit v1.2.3