1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

[AArch64] Output the pseudo SPACE in asm and object files

Summary: It outputs nothing, but is useful for writing tests, checking asm output.

Reviewers: t.p.northover, ostannard, tellenbach

Reviewed By: tellenbach

Subscribers: tellenbach, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

Change-Id: I6b58310e9e5632f0976d2000ce975ee28df90ebe
This commit is contained in:
Momchil Velikov 2019-11-01 15:01:36 +00:00
parent 2d7b2584ac
commit 5ea7edc062
3 changed files with 28 additions and 2 deletions

View File

@ -282,6 +282,12 @@ void AArch64InstPrinter::printInst(const MCInst *MI, raw_ostream &O,
return; return;
} }
if (Opcode == AArch64::SPACE) {
O << '\t' << MAI.getCommentString() << " SPACE";
printAnnotation(O, Annot);
return;
}
// Instruction TSB is specified as a one operand instruction, but 'csync' is // Instruction TSB is specified as a one operand instruction, but 'csync' is
// not encoded, so for printing it is treated as a special case here: // not encoded, so for printing it is treated as a special case here:
if (Opcode == AArch64::TSB) { if (Opcode == AArch64::TSB) {

View File

@ -601,8 +601,12 @@ void AArch64MCCodeEmitter::encodeInstruction(const MCInst &MI, raw_ostream &OS,
MCFixupKind Fixup = MCFixupKind(AArch64::fixup_aarch64_tlsdesc_call); MCFixupKind Fixup = MCFixupKind(AArch64::fixup_aarch64_tlsdesc_call);
Fixups.push_back(MCFixup::create(0, MI.getOperand(0).getExpr(), Fixup)); Fixups.push_back(MCFixup::create(0, MI.getOperand(0).getExpr(), Fixup));
return; return;
} else if (MI.getOpcode() == AArch64::CompilerBarrier) { }
// This just prevents the compiler from reordering accesses, no actual code.
if (MI.getOpcode() == AArch64::CompilerBarrier ||
MI.getOpcode() == AArch64::SPACE) {
// CompilerBarrier just prevents the compiler from reordering accesses, and
// SPACE just increases basic block size, in both cases no actual code.
return; return;
} }

View File

@ -0,0 +1,16 @@
; RUN: llc -mtriple aarch64 %s -o - | FileCheck %s
; RUN: llc -mtriple aarch64 -filetype=obj %s -o - | llvm-objdump --arch=aarch64 -d - | FileCheck %s --check-prefix=DUMP
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
define dso_local void @f(i64 %v) {
entry:
%dummy = tail call i64 @llvm.aarch64.space(i32 32684, i64 %v)
ret void
}
; CHECK: // SPACE
; CHECK-NEXT: ret
; DUMP-LABEL: f:
; DUMP-NEXT: ret
declare dso_local i64 @llvm.aarch64.space(i32, i64) local_unnamed_addr #0