mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-19 00:14:20 +00:00
When emitting a label for a PostCall safe point, the machine
instruction to insert before can be end(). getDebugLoc on end() returns an invalid value, therefore use the debug loc of the call instruction, and give it to InsertLabel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81207 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
de782a2321
commit
22f35ace45
@ -72,7 +72,8 @@ namespace {
|
|||||||
void FindSafePoints(MachineFunction &MF);
|
void FindSafePoints(MachineFunction &MF);
|
||||||
void VisitCallPoint(MachineBasicBlock::iterator MI);
|
void VisitCallPoint(MachineBasicBlock::iterator MI);
|
||||||
unsigned InsertLabel(MachineBasicBlock &MBB,
|
unsigned InsertLabel(MachineBasicBlock &MBB,
|
||||||
MachineBasicBlock::iterator MI) const;
|
MachineBasicBlock::iterator MI,
|
||||||
|
DebugLoc DL) const;
|
||||||
|
|
||||||
void FindStackOffsets(MachineFunction &MF);
|
void FindStackOffsets(MachineFunction &MF);
|
||||||
|
|
||||||
@ -329,11 +330,13 @@ void MachineCodeAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
unsigned MachineCodeAnalysis::InsertLabel(MachineBasicBlock &MBB,
|
unsigned MachineCodeAnalysis::InsertLabel(MachineBasicBlock &MBB,
|
||||||
MachineBasicBlock::iterator MI) const {
|
MachineBasicBlock::iterator MI,
|
||||||
|
DebugLoc DL) const {
|
||||||
unsigned Label = MMI->NextLabelID();
|
unsigned Label = MMI->NextLabelID();
|
||||||
// N.B. we assume that MI is *not* equal to the "end()" iterator.
|
|
||||||
BuildMI(MBB, MI, MI->getDebugLoc(),
|
BuildMI(MBB, MI, DL,
|
||||||
TII->get(TargetInstrInfo::GC_LABEL)).addImm(Label);
|
TII->get(TargetInstrInfo::GC_LABEL)).addImm(Label);
|
||||||
|
|
||||||
return Label;
|
return Label;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -344,10 +347,12 @@ void MachineCodeAnalysis::VisitCallPoint(MachineBasicBlock::iterator CI) {
|
|||||||
++RAI;
|
++RAI;
|
||||||
|
|
||||||
if (FI->getStrategy().needsSafePoint(GC::PreCall))
|
if (FI->getStrategy().needsSafePoint(GC::PreCall))
|
||||||
FI->addSafePoint(GC::PreCall, InsertLabel(*CI->getParent(), CI));
|
FI->addSafePoint(GC::PreCall, InsertLabel(*CI->getParent(), CI,
|
||||||
|
CI->getDebugLoc()));
|
||||||
|
|
||||||
if (FI->getStrategy().needsSafePoint(GC::PostCall))
|
if (FI->getStrategy().needsSafePoint(GC::PostCall))
|
||||||
FI->addSafePoint(GC::PostCall, InsertLabel(*CI->getParent(), RAI));
|
FI->addSafePoint(GC::PostCall, InsertLabel(*CI->getParent(), RAI,
|
||||||
|
CI->getDebugLoc()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MachineCodeAnalysis::FindSafePoints(MachineFunction &MF) {
|
void MachineCodeAnalysis::FindSafePoints(MachineFunction &MF) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user