aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorDjordje Todorovic <djordje.todorovic@rt-rk.com>2020-02-10 09:49:14 +0100
committerDjordje Todorovic <djordje.todorovic@rt-rk.com>2020-02-10 10:03:14 +0100
commit68908993ebd2af459cd0f2ed6ab340bf62fb3e9d (patch)
tree77c6591e54948188960a34e3d64d842301b74106 /llvm/lib/CodeGen/MachineFunction.cpp
parentd2e0fee77bc82a54bcc11ce778ce12f068f9e326 (diff)
downloadllvm-68908993ebd2af459cd0f2ed6ab340bf62fb3e9d.zip
llvm-68908993ebd2af459cd0f2ed6ab340bf62fb3e9d.tar.gz
llvm-68908993ebd2af459cd0f2ed6ab340bf62fb3e9d.tar.bz2
[CSInfo] Use isCandidateForCallSiteEntry() when updating the CSInfo
Use the isCandidateForCallSiteEntry(). This should mostly be an NFC, but there are some parts ensuring the moveCallSiteInfo() and copyCallSiteInfo() operate with call site entry candidates (both Src and Dest should be the call site entry candidates). Differential Revision: https://reviews.llvm.org/D74122
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index 10b6aa9..06b5ab5 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -863,7 +863,8 @@ try_next:;
MachineFunction::CallSiteInfoMap::iterator
MachineFunction::getCallSiteInfo(const MachineInstr *MI) {
- assert(MI->isCall() && "Call site info refers only to call instructions!");
+ assert(MI->isCandidateForCallSiteEntry() &&
+ "Call site info refers only to call (MI) candidates");
if (!Target.Options.EnableDebugEntryValues)
return CallSitesInfo.end();
@@ -872,7 +873,11 @@ MachineFunction::getCallSiteInfo(const MachineInstr *MI) {
void MachineFunction::moveCallSiteInfo(const MachineInstr *Old,
const MachineInstr *New) {
- assert(New->isCall() && "Call site info refers only to call instructions!");
+ assert(Old->isCandidateForCallSiteEntry() &&
+ "Call site info refers only to call (MI) candidates");
+
+ if (!New->isCandidateForCallSiteEntry())
+ return eraseCallSiteInfo(Old);
CallSiteInfoMap::iterator CSIt = getCallSiteInfo(Old);
if (CSIt == CallSitesInfo.end())
@@ -884,6 +889,8 @@ void MachineFunction::moveCallSiteInfo(const MachineInstr *Old,
}
void MachineFunction::eraseCallSiteInfo(const MachineInstr *MI) {
+ assert(MI->isCandidateForCallSiteEntry() &&
+ "Call site info refers only to call (MI) candidates");
CallSiteInfoMap::iterator CSIt = getCallSiteInfo(MI);
if (CSIt == CallSitesInfo.end())
return;
@@ -892,7 +899,11 @@ void MachineFunction::eraseCallSiteInfo(const MachineInstr *MI) {
void MachineFunction::copyCallSiteInfo(const MachineInstr *Old,
const MachineInstr *New) {
- assert(New->isCall() && "Call site info refers only to call instructions!");
+ assert(Old->isCandidateForCallSiteEntry() &&
+ "Call site info refers only to call (MI) candidates");
+
+ if (!New->isCandidateForCallSiteEntry())
+ return eraseCallSiteInfo(Old);
CallSiteInfoMap::iterator CSIt = getCallSiteInfo(Old);
if (CSIt == CallSitesInfo.end())