mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-07 04:21:39 +00:00
[Hexagon] Fixing leak in padEndloop by allocating in MCContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253019 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
08ccc7e7d1
commit
e78416caa5
@ -198,7 +198,7 @@ void HexagonAsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||
}
|
||||
else {
|
||||
HexagonLowerToMC(MI, MCB, *this);
|
||||
HexagonMCInstrInfo::padEndloop(MCB);
|
||||
HexagonMCInstrInfo::padEndloop(OutStreamer->getContext(), MCB);
|
||||
}
|
||||
// Examine the packet and try to find instructions that can be converted
|
||||
// to compounds.
|
||||
|
@ -50,7 +50,7 @@ void HexagonMCELFStreamer::EmitInstruction(const MCInst &MCK,
|
||||
|
||||
// Examines packet and pad the packet, if needed, when an
|
||||
// end-loop is in the bundle.
|
||||
HexagonMCInstrInfo::padEndloop(*MCB);
|
||||
HexagonMCInstrInfo::padEndloop(getContext(), *MCB);
|
||||
HexagonMCShuffle(*MCII, STI, *MCB);
|
||||
|
||||
assert(HexagonMCInstrInfo::bundleSize(*MCB) <= HEXAGON_PACKET_SIZE);
|
||||
|
@ -79,7 +79,7 @@ bool HexagonMCInstrInfo::canonicalizePacket(MCInstrInfo const &MCII,
|
||||
}
|
||||
// Examines packet and pad the packet, if needed, when an
|
||||
// end-loop is in the bundle.
|
||||
HexagonMCInstrInfo::padEndloop(MCB);
|
||||
HexagonMCInstrInfo::padEndloop(Context, MCB);
|
||||
// If compounding and duplexing didn't reduce the size below
|
||||
// 4 or less we have a packet that is too big.
|
||||
if (HexagonMCInstrInfo::bundleSize(MCB) > HEXAGON_PACKET_SIZE)
|
||||
@ -569,7 +569,7 @@ int64_t HexagonMCInstrInfo::minConstant(MCInst const &MCI, size_t Index) {
|
||||
return Value;
|
||||
}
|
||||
|
||||
void HexagonMCInstrInfo::padEndloop(MCInst &MCB) {
|
||||
void HexagonMCInstrInfo::padEndloop(MCContext &Context, MCInst &MCB) {
|
||||
MCInst Nop;
|
||||
Nop.setOpcode(Hexagon::A2_nop);
|
||||
assert(isBundle(MCB));
|
||||
@ -577,7 +577,7 @@ void HexagonMCInstrInfo::padEndloop(MCInst &MCB) {
|
||||
(HexagonMCInstrInfo::bundleSize(MCB) < HEXAGON_PACKET_INNER_SIZE)) ||
|
||||
((HexagonMCInstrInfo::isOuterLoop(MCB) &&
|
||||
(HexagonMCInstrInfo::bundleSize(MCB) < HEXAGON_PACKET_OUTER_SIZE))))
|
||||
MCB.addOperand(MCOperand::createInst(new MCInst(Nop)));
|
||||
MCB.addOperand(MCOperand::createInst(new (Context) MCInst(Nop)));
|
||||
}
|
||||
|
||||
bool HexagonMCInstrInfo::prefersSlot3(MCInstrInfo const &MCII,
|
||||
|
@ -261,7 +261,7 @@ bool isSoloAin1(MCInstrInfo const &MCII, MCInst const &MCI);
|
||||
bool isVector(MCInstrInfo const &MCII, MCInst const &MCI);
|
||||
|
||||
// Pad the bundle with nops to satisfy endloop requirements
|
||||
void padEndloop(MCInst &MCI);
|
||||
void padEndloop(MCContext &Context, MCInst &MCI);
|
||||
|
||||
bool prefersSlot3(MCInstrInfo const &MCII, MCInst const &MCI);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user