mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 21:29:41 +00:00
emit integer and fp zeros as (e.g.) .byte 0 instead of .space 1,
for tidiness. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93992 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2dd245c469
commit
043c4e5c1d
@ -700,9 +700,7 @@ void AsmPrinter::EOL() const {
|
|||||||
void AsmPrinter::EOL(const Twine &Comment) const {
|
void AsmPrinter::EOL(const Twine &Comment) const {
|
||||||
if (VerboseAsm && !Comment.isTriviallyEmpty()) {
|
if (VerboseAsm && !Comment.isTriviallyEmpty()) {
|
||||||
O.PadToColumn(MAI->getCommentColumn());
|
O.PadToColumn(MAI->getCommentColumn());
|
||||||
O << MAI->getCommentString()
|
O << MAI->getCommentString() << ' ' << Comment;
|
||||||
<< ' '
|
|
||||||
<< Comment;
|
|
||||||
}
|
}
|
||||||
O << '\n';
|
O << '\n';
|
||||||
}
|
}
|
||||||
@ -1212,7 +1210,7 @@ static void EmitGlobalConstantLargeInt(const ConstantInt *CI,
|
|||||||
|
|
||||||
/// EmitGlobalConstant - Print a general LLVM constant to the .s file.
|
/// EmitGlobalConstant - Print a general LLVM constant to the .s file.
|
||||||
void AsmPrinter::EmitGlobalConstant(const Constant *CV, unsigned AddrSpace) {
|
void AsmPrinter::EmitGlobalConstant(const Constant *CV, unsigned AddrSpace) {
|
||||||
if (CV->isNullValue() || isa<UndefValue>(CV)) {
|
if (isa<ConstantAggregateZero>(CV) || isa<UndefValue>(CV)) {
|
||||||
uint64_t Size = TM.getTargetData()->getTypeAllocSize(CV->getType());
|
uint64_t Size = TM.getTargetData()->getTypeAllocSize(CV->getType());
|
||||||
return OutStreamer.EmitZeros(Size, AddrSpace);
|
return OutStreamer.EmitZeros(Size, AddrSpace);
|
||||||
}
|
}
|
||||||
@ -1250,6 +1248,7 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV, unsigned AddrSpace) {
|
|||||||
if (const ConstantVector *V = dyn_cast<ConstantVector>(CV))
|
if (const ConstantVector *V = dyn_cast<ConstantVector>(CV))
|
||||||
return EmitGlobalConstantVector(V, AddrSpace, *this);
|
return EmitGlobalConstantVector(V, AddrSpace, *this);
|
||||||
|
|
||||||
|
// ConstantExpr case.
|
||||||
printDataDirective(CV->getType(), AddrSpace);
|
printDataDirective(CV->getType(), AddrSpace);
|
||||||
EmitConstantValueOnly(CV);
|
EmitConstantValueOnly(CV);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
@ -1307,19 +1306,17 @@ void AsmPrinter::processDebugLoc(const MachineInstr *MI,
|
|||||||
if (CurDLT.getScope().isNull())
|
if (CurDLT.getScope().isNull())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (BeforePrintingInsn) {
|
if (!BeforePrintingInsn) {
|
||||||
if (CurDLT.getNode() != PrevDLT) {
|
|
||||||
unsigned L = DW->RecordSourceLine(CurDLT.getLineNumber(),
|
|
||||||
CurDLT.getColumnNumber(),
|
|
||||||
CurDLT.getScope().getNode());
|
|
||||||
printLabel(L);
|
|
||||||
O << '\n';
|
|
||||||
DW->BeginScope(MI, L);
|
|
||||||
PrevDLT = CurDLT.getNode();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// After printing instruction
|
// After printing instruction
|
||||||
DW->EndScope(MI);
|
DW->EndScope(MI);
|
||||||
|
} else if (CurDLT.getNode() != PrevDLT) {
|
||||||
|
unsigned L = DW->RecordSourceLine(CurDLT.getLineNumber(),
|
||||||
|
CurDLT.getColumnNumber(),
|
||||||
|
CurDLT.getScope().getNode());
|
||||||
|
printLabel(L);
|
||||||
|
O << '\n';
|
||||||
|
DW->BeginScope(MI, L);
|
||||||
|
PrevDLT = CurDLT.getNode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
@G1 = global i32 4712, section "Address=412"
|
@G1 = global i32 4712, section "Address=412"
|
||||||
; CHECK: @G1.412..user_section.# IDATA 412
|
; CHECK: @G1.412..user_section.# IDATA 412
|
||||||
; CHECK: @G1 dl 4712
|
; CHECK: @G1
|
||||||
|
; CHECK: dl 4712
|
||||||
|
|
||||||
@G2 = global i32 0, section "Address=412"
|
@G2 = global i32 0, section "Address=412"
|
||||||
; CHECK: @G2.412..user_section.# UDATA 412
|
; CHECK: @G2.412..user_section.# UDATA 412
|
||||||
@ -10,6 +11,7 @@
|
|||||||
|
|
||||||
@G3 = addrspace(1) constant i32 4712, section "Address=412"
|
@G3 = addrspace(1) constant i32 4712, section "Address=412"
|
||||||
; CHECK: @G3.412..user_section.# ROMDATA 412
|
; CHECK: @G3.412..user_section.# ROMDATA 412
|
||||||
; CHECK: @G3 rom_dl 4712
|
; CHECK: @G3
|
||||||
|
; CHECK: rom_dl 4712
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu > %t
|
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu > %t
|
||||||
; RUN: not grep xor %t
|
; RUN: not grep xor %t
|
||||||
; RUN: not grep movap %t
|
; RUN: not grep movap %t
|
||||||
; RUN: grep {\\.zero} %t
|
; RUN: grep {\\.quad.*0} %t
|
||||||
|
|
||||||
; Remat should be able to fold the zero constant into the div instructions
|
; Remat should be able to fold the zero constant into the div instructions
|
||||||
; as a constant-pool load.
|
; as a constant-pool load.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user