1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

[AArch64] Print instruction before atomic semantic annotations

Commit r353303 added annotations when acquire semantics
were dropped from an instruction.

printAnnotation was called before printInstruction.
So if you didn't set a separate comment output stream
you got <comment><instr> instead of <instr><comment>
as expected.

To fix this move the new printAnnotation to after
the instruction is printed.

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

llvm-svn: 354565
This commit is contained in:
David Spickett 2019-02-21 10:42:49 +00:00
parent d32cd3c980
commit 886462b5ef

View File

@ -69,11 +69,6 @@ void AArch64InstPrinter::printInst(const MCInst *MI, raw_ostream &O,
return;
}
if (atomicBarrierDroppedOnZero(Opcode) &&
(MI->getOperand(0).getReg() == AArch64::XZR ||
MI->getOperand(0).getReg() == AArch64::WZR))
printAnnotation(O, "acquire semantics dropped since destination is zero");
// SBFM/UBFM should print to a nicer aliased form if possible.
if (Opcode == AArch64::SBFMXri || Opcode == AArch64::SBFMWri ||
Opcode == AArch64::UBFMXri || Opcode == AArch64::UBFMWri) {
@ -297,6 +292,12 @@ void AArch64InstPrinter::printInst(const MCInst *MI, raw_ostream &O,
printInstruction(MI, STI, O);
printAnnotation(O, Annot);
if (atomicBarrierDroppedOnZero(Opcode) &&
(MI->getOperand(0).getReg() == AArch64::XZR ||
MI->getOperand(0).getReg() == AArch64::WZR)) {
printAnnotation(O, "acquire semantics dropped since destination is zero");
}
}
static bool isTblTbxInstruction(unsigned Opcode, StringRef &Layout,