diff options
author | Jim Laskey <jlaskey@mac.com> | 2007-01-26 14:34:52 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2007-01-26 14:34:52 +0000 |
commit | 1ee29257428960fede862fcfdbe80d5d007927e9 (patch) | |
tree | 14237530ec191a46f19f476c9b4fac38b47f8bf6 /lib/Target | |
parent | 2b935d55b04b8dfeedc67c3b376efd523344c44d (diff) | |
download | llvm-1ee29257428960fede862fcfdbe80d5d007927e9.tar.gz llvm-1ee29257428960fede862fcfdbe80d5d007927e9.tar.bz2 llvm-1ee29257428960fede862fcfdbe80d5d007927e9.tar.xz |
Make LABEL a builtin opcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33537 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/ARM/ARMConstantIslandPass.cpp | 2 | ||||
-rw-r--r-- | lib/Target/ARM/ARMISelLowering.cpp | 2 | ||||
-rw-r--r-- | lib/Target/ARM/ARMInstrInfo.cpp | 4 | ||||
-rw-r--r-- | lib/Target/ARM/ARMInstrInfo.h | 5 | ||||
-rw-r--r-- | lib/Target/ARM/ARMInstrInfo.td | 5 | ||||
-rw-r--r-- | lib/Target/Alpha/AlphaISelLowering.cpp | 2 | ||||
-rw-r--r-- | lib/Target/IA64/IA64ISelLowering.cpp | 2 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCBranchSelector.cpp | 3 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCISelLowering.cpp | 2 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCInstrInfo.h | 7 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCInstrInfo.td | 4 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCRegisterInfo.cpp | 4 | ||||
-rw-r--r-- | lib/Target/Sparc/SparcISelDAGToDAG.cpp | 2 | ||||
-rw-r--r-- | lib/Target/Target.td | 6 | ||||
-rw-r--r-- | lib/Target/TargetSelectionDAG.td | 3 | ||||
-rw-r--r-- | lib/Target/X86/X86CodeEmitter.cpp | 2 | ||||
-rw-r--r-- | lib/Target/X86/X86ISelLowering.cpp | 2 | ||||
-rw-r--r-- | lib/Target/X86/X86InstrInfo.cpp | 8 | ||||
-rw-r--r-- | lib/Target/X86/X86InstrInfo.h | 5 | ||||
-rw-r--r-- | lib/Target/X86/X86InstrInfo.td | 4 | ||||
-rw-r--r-- | lib/Target/X86/X86RegisterInfo.cpp | 4 |
21 files changed, 23 insertions, 55 deletions
diff --git a/lib/Target/ARM/ARMConstantIslandPass.cpp b/lib/Target/ARM/ARMConstantIslandPass.cpp index db50bde384..26119059fe 100644 --- a/lib/Target/ARM/ARMConstantIslandPass.cpp +++ b/lib/Target/ARM/ARMConstantIslandPass.cpp @@ -336,6 +336,8 @@ unsigned ARMConstantIslands::GetInstSize(MachineInstr *MI) const { // If this machine instr is an inline asm, measure it. if (MI->getOpcode() == ARM::INLINEASM) return TAI->getInlineAsmLength(MI->getOperand(0).getSymbolName()); + if (MI->getOpcode() == ARM::LABEL) + return 0; assert(0 && "Unknown or unset size field for instr!"); break; case ARMII::Size8Bytes: return 8; // Arm instruction x 2. diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp index 031cd0a2f5..594a48e788 100644 --- a/lib/Target/ARM/ARMISelLowering.cpp +++ b/lib/Target/ARM/ARMISelLowering.cpp @@ -147,7 +147,7 @@ ARMTargetLowering::ARMTargetLowering(TargetMachine &TM) setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand); // FIXME - use subtarget debug flags if (Subtarget->isTargetDarwin()) - setOperationAction(ISD::DEBUG_LABEL, MVT::Other, Expand); + setOperationAction(ISD::LABEL, MVT::Other, Expand); setOperationAction(ISD::RET, MVT::Other, Custom); setOperationAction(ISD::GlobalAddress, MVT::i32, Custom); diff --git a/lib/Target/ARM/ARMInstrInfo.cpp b/lib/Target/ARM/ARMInstrInfo.cpp index b5425fec8a..86d6614df3 100644 --- a/lib/Target/ARM/ARMInstrInfo.cpp +++ b/lib/Target/ARM/ARMInstrInfo.cpp @@ -30,10 +30,6 @@ ARMInstrInfo::ARMInstrInfo(const ARMSubtarget &STI) RI(*this, STI) { } -unsigned ARMInstrInfo::getDWARF_LABELOpcode() const { - return ARM::DWARF_LABEL; -} - const TargetRegisterClass *ARMInstrInfo::getPointerRegClass() const { return &ARM::GPRRegClass; } diff --git a/lib/Target/ARM/ARMInstrInfo.h b/lib/Target/ARM/ARMInstrInfo.h index 0208121f14..db52a2dbc7 100644 --- a/lib/Target/ARM/ARMInstrInfo.h +++ b/lib/Target/ARM/ARMInstrInfo.h @@ -80,11 +80,6 @@ public: /// This is used for addressing modes. virtual const TargetRegisterClass *getPointerRegClass() const; - /// getDWARF_LABELOpcode - Return the opcode of the target's DWARF_LABEL - /// instruction if it has one. This is used by codegen passes that update - /// DWARF line number info as they modify the code. - virtual unsigned getDWARF_LABELOpcode() const; - /// Return true if the instruction is a register to register move and /// leave the source and dest operands in the passed parameters. /// diff --git a/lib/Target/ARM/ARMInstrInfo.td b/lib/Target/ARM/ARMInstrInfo.td index 4762a0e8d9..63aea02d68 100644 --- a/lib/Target/ARM/ARMInstrInfo.td +++ b/lib/Target/ARM/ARMInstrInfo.td @@ -513,11 +513,6 @@ PseudoInst<(ops i32imm:$line, i32imm:$col, i32imm:$file), ".loc $file, $line, $col", [(dwarf_loc (i32 imm:$line), (i32 imm:$col), (i32 imm:$file))]>; -def DWARF_LABEL : -PseudoInst<(ops i32imm:$id), - "\nLdebug_loc${id:no_hash}:", - [(dwarf_label (i32 imm:$id))]>; - def PICADD : AI1<(ops GPR:$dst, GPR:$a, pclabel:$cp), "\n$cp:\n\tadd $dst, pc, $a", [(set GPR:$dst, (ARMpic_add GPR:$a, imm:$cp))]>; diff --git a/lib/Target/Alpha/AlphaISelLowering.cpp b/lib/Target/Alpha/AlphaISelLowering.cpp index 80c40cdbd1..f0e5be6a0c 100644 --- a/lib/Target/Alpha/AlphaISelLowering.cpp +++ b/lib/Target/Alpha/AlphaISelLowering.cpp @@ -109,7 +109,7 @@ AlphaTargetLowering::AlphaTargetLowering(TargetMachine &TM) : TargetLowering(TM) // We don't have line number support yet. setOperationAction(ISD::LOCATION, MVT::Other, Expand); setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand); - setOperationAction(ISD::DEBUG_LABEL, MVT::Other, Expand); + setOperationAction(ISD::LABEL, MVT::Other, Expand); // Not implemented yet. setOperationAction(ISD::STACKSAVE, MVT::Other, Expand); diff --git a/lib/Target/IA64/IA64ISelLowering.cpp b/lib/Target/IA64/IA64ISelLowering.cpp index 6fddb37367..2d14a2bc5f 100644 --- a/lib/Target/IA64/IA64ISelLowering.cpp +++ b/lib/Target/IA64/IA64ISelLowering.cpp @@ -88,7 +88,7 @@ IA64TargetLowering::IA64TargetLowering(TargetMachine &TM) // We don't have line number support yet. setOperationAction(ISD::LOCATION, MVT::Other, Expand); setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand); - setOperationAction(ISD::DEBUG_LABEL, MVT::Other, Expand); + setOperationAction(ISD::LABEL, MVT::Other, Expand); //IA64 has these, but they are not implemented setOperationAction(ISD::CTTZ , MVT::i64 , Expand); diff --git a/lib/Target/PowerPC/PPCBranchSelector.cpp b/lib/Target/PowerPC/PPCBranchSelector.cpp index e8274f3b9e..2cd8325ce3 100644 --- a/lib/Target/PowerPC/PPCBranchSelector.cpp +++ b/lib/Target/PowerPC/PPCBranchSelector.cpp @@ -66,6 +66,9 @@ static unsigned getNumBytesForInstruction(MachineInstr *MI) { const char *AsmStr = MI->getOperand(0).getSymbolName(); return MF->getTarget().getTargetAsmInfo()->getInlineAsmLength(AsmStr); } + case PPC::LABEL: { + return 0; + } default: return 4; // PowerPC instructions are all 4 bytes } diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp index 5fb567b270..097ca91a30 100644 --- a/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/lib/Target/PowerPC/PPCISelLowering.cpp @@ -147,7 +147,7 @@ PPCTargetLowering::PPCTargetLowering(PPCTargetMachine &TM) setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand); // FIXME - use subtarget debug flags if (!TM.getSubtarget<PPCSubtarget>().isDarwin()) - setOperationAction(ISD::DEBUG_LABEL, MVT::Other, Expand); + setOperationAction(ISD::LABEL, MVT::Other, Expand); // We want to legalize GlobalAddress and ConstantPool nodes into the // appropriate instructions to materialize the address. diff --git a/lib/Target/PowerPC/PPCInstrInfo.h b/lib/Target/PowerPC/PPCInstrInfo.h index c519d622c5..9005963df6 100644 --- a/lib/Target/PowerPC/PPCInstrInfo.h +++ b/lib/Target/PowerPC/PPCInstrInfo.h @@ -77,13 +77,6 @@ public: /// This is used for addressing modes. virtual const TargetRegisterClass *getPointerRegClass() const; - /// getDWARF_LABELOpcode - Return the opcode of the target's DWARF_LABEL - /// instruction if it has one. This is used by codegen passes that update - /// DWARF line number info as they modify the code. - virtual unsigned getDWARF_LABELOpcode() const { - return PPC::DWARF_LABEL; - } - // Return true if the instruction is a register to register move and // leave the source and dest operands in the passed parameters. // diff --git a/lib/Target/PowerPC/PPCInstrInfo.td b/lib/Target/PowerPC/PPCInstrInfo.td index c405b2b9d4..7b03f92eef 100644 --- a/lib/Target/PowerPC/PPCInstrInfo.td +++ b/lib/Target/PowerPC/PPCInstrInfo.td @@ -1015,10 +1015,6 @@ def DWARF_LOC : Pseudo<(ops i32imm:$line, i32imm:$col, i32imm:$file), [(dwarf_loc (i32 imm:$line), (i32 imm:$col), (i32 imm:$file))]>; -def DWARF_LABEL : Pseudo<(ops i32imm:$id), - "\n${:private}debug_loc$id:", - [(dwarf_label (i32 imm:$id))]>; - //===----------------------------------------------------------------------===// // PowerPC Instruction Patterns // diff --git a/lib/Target/PowerPC/PPCRegisterInfo.cpp b/lib/Target/PowerPC/PPCRegisterInfo.cpp index 7e5d693c36..75c92615ea 100644 --- a/lib/Target/PowerPC/PPCRegisterInfo.cpp +++ b/lib/Target/PowerPC/PPCRegisterInfo.cpp @@ -822,7 +822,7 @@ void PPCRegisterInfo::emitPrologue(MachineFunction &MF) const { if (hasInfo) { // Mark effective beginning of when frame pointer becomes valid. FrameLabelId = DebugInfo->NextLabelID(); - BuildMI(MBB, MBBI, TII.get(PPC::DWARF_LABEL)).addImm(FrameLabelId); + BuildMI(MBB, MBBI, TII.get(PPC::LABEL)).addImm(FrameLabelId); } // Adjust stack pointer: r1 += NegFrameSize. @@ -902,7 +902,7 @@ void PPCRegisterInfo::emitPrologue(MachineFunction &MF) const { // Mark effective beginning of when frame pointer is ready. unsigned ReadyLabelId = DebugInfo->NextLabelID(); - BuildMI(MBB, MBBI, TII.get(PPC::DWARF_LABEL)).addImm(ReadyLabelId); + BuildMI(MBB, MBBI, TII.get(PPC::LABEL)).addImm(ReadyLabelId); MachineLocation FPDst(HasFP ? (IsPPC64 ? PPC::X31 : PPC::R31) : (IsPPC64 ? PPC::X1 : PPC::R1)); diff --git a/lib/Target/Sparc/SparcISelDAGToDAG.cpp b/lib/Target/Sparc/SparcISelDAGToDAG.cpp index 43059ea9ee..f361b4670a 100644 --- a/lib/Target/Sparc/SparcISelDAGToDAG.cpp +++ b/lib/Target/Sparc/SparcISelDAGToDAG.cpp @@ -207,7 +207,7 @@ SparcTargetLowering::SparcTargetLowering(TargetMachine &TM) // We don't have line number support yet. setOperationAction(ISD::LOCATION, MVT::Other, Expand); setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand); - setOperationAction(ISD::DEBUG_LABEL, MVT::Other, Expand); + setOperationAction(ISD::LABEL, MVT::Other, Expand); // RET must be custom lowered, to meet ABI requirements setOperationAction(ISD::RET , MVT::Other, Custom); diff --git a/lib/Target/Target.td b/lib/Target/Target.td index 5f8d2e260b..96e4e28375 100644 --- a/lib/Target/Target.td +++ b/lib/Target/Target.td @@ -266,6 +266,12 @@ def INLINEASM : Instruction { let AsmString = ""; let Namespace = "TargetInstrInfo"; } +def LABEL : Instruction { + let OperandList = (ops i32imm:$id); + let AsmString = ""; + let Namespace = "TargetInstrInfo"; + let hasCtrlDep = 1; +} //===----------------------------------------------------------------------===// // AsmWriter - This class can be implemented by targets that need to customize diff --git a/lib/Target/TargetSelectionDAG.td b/lib/Target/TargetSelectionDAG.td index 989f1e26ac..17c0ddd12f 100644 --- a/lib/Target/TargetSelectionDAG.td +++ b/lib/Target/TargetSelectionDAG.td @@ -755,8 +755,5 @@ def SDT_dwarf_loc : SDTypeProfile<0, 3, [SDTCisInt<0>, SDTCisInt<1>, SDTCisInt<2>]>; def dwarf_loc : SDNode<"ISD::DEBUG_LOC", SDT_dwarf_loc,[SDNPHasChain]>; -def SDT_dwarf_label : SDTypeProfile<0, 1, [SDTCisInt<0>]>; -def dwarf_label : SDNode<"ISD::DEBUG_LABEL", SDT_dwarf_label,[SDNPHasChain]>; - diff --git a/lib/Target/X86/X86CodeEmitter.cpp b/lib/Target/X86/X86CodeEmitter.cpp index fa3cd57b8a..d27e647e40 100644 --- a/lib/Target/X86/X86CodeEmitter.cpp +++ b/lib/Target/X86/X86CodeEmitter.cpp @@ -630,6 +630,8 @@ void Emitter::emitInstruction(const MachineInstr &MI) { assert(0 && "psuedo instructions should be removed before code emission"); case TargetInstrInfo::INLINEASM: assert(0 && "JIT does not support inline asm!\n"); + case TargetInstrInfo::LABEL: + assert(0 && "JIT does not support meta labels!\n"); case X86::IMPLICIT_USE: case X86::IMPLICIT_DEF: case X86::IMPLICIT_DEF_GR8: diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 0c2c4e6c04..9f9fb7248e 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -235,7 +235,7 @@ X86TargetLowering::X86TargetLowering(TargetMachine &TM) if (!Subtarget->isTargetDarwin() && !Subtarget->isTargetELF() && !Subtarget->isTargetCygMing()) - setOperationAction(ISD::DEBUG_LABEL, MVT::Other, Expand); + setOperationAction(ISD::LABEL, MVT::Other, Expand); // VASTART needs to be custom lowered to use the VarArgsFrameIndex setOperationAction(ISD::VASTART , MVT::Other, Custom); diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp index 452eb1f2cf..87f04b80ba 100644 --- a/lib/Target/X86/X86InstrInfo.cpp +++ b/lib/Target/X86/X86InstrInfo.cpp @@ -26,14 +26,6 @@ X86InstrInfo::X86InstrInfo(X86TargetMachine &tm) TM(tm), RI(tm, *this) { } -/// getDWARF_LABELOpcode - Return the opcode of the target's DWARF_LABEL -/// instruction if it has one. This is used by codegen passes that update -/// DWARF line number info as they modify the code. -unsigned X86InstrInfo::getDWARF_LABELOpcode() const { - return X86::DWARF_LABEL; -} - - bool X86InstrInfo::isMoveInstr(const MachineInstr& MI, unsigned& sourceReg, unsigned& destReg) const { diff --git a/lib/Target/X86/X86InstrInfo.h b/lib/Target/X86/X86InstrInfo.h index 4e79c71540..b753a88f1d 100644 --- a/lib/Target/X86/X86InstrInfo.h +++ b/lib/Target/X86/X86InstrInfo.h @@ -237,11 +237,6 @@ public: unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const; unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const; - /// getDWARF_LABELOpcode - Return the opcode of the target's DWARF_LABEL - /// instruction if it has one. This is used by codegen passes that update - /// DWARF line number info as they modify the code. - virtual unsigned getDWARF_LABELOpcode() const; - /// convertToThreeAddress - This method must be implemented by targets that /// set the M_CONVERTIBLE_TO_3_ADDR flag. When this flag is set, the target /// may be able to convert a two-address instruction into a true diff --git a/lib/Target/X86/X86InstrInfo.td b/lib/Target/X86/X86InstrInfo.td index 8518e67337..50bef5676c 100644 --- a/lib/Target/X86/X86InstrInfo.td +++ b/lib/Target/X86/X86InstrInfo.td @@ -2449,10 +2449,6 @@ def DWARF_LOC : I<0, Pseudo, (ops i32imm:$line, i32imm:$col, i32imm:$file), [(dwarf_loc (i32 imm:$line), (i32 imm:$col), (i32 imm:$file))]>; -def DWARF_LABEL : I<0, Pseudo, (ops i32imm:$id), - "\n${:private}debug_loc${id:debug}:", - [(dwarf_label (i32 imm:$id))]>; - //===----------------------------------------------------------------------===// // Non-Instruction Patterns //===----------------------------------------------------------------------===// diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp index c47d1c7982..4b13dac63c 100644 --- a/lib/Target/X86/X86RegisterInfo.cpp +++ b/lib/Target/X86/X86RegisterInfo.cpp @@ -1026,7 +1026,7 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const { if (hasInfo) { // Mark effective beginning of when frame pointer becomes valid. FrameLabelId = DebugInfo->NextLabelID(); - BuildMI(MBB, MBBI, TII.get(X86::DWARF_LABEL)).addImm(FrameLabelId); + BuildMI(MBB, MBBI, TII.get(X86::LABEL)).addImm(FrameLabelId); } if (hasFP(MF)) { @@ -1078,7 +1078,7 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const { // Mark effective beginning of when frame pointer is ready. unsigned ReadyLabelId = DebugInfo->NextLabelID(); - BuildMI(MBB, MBBI, TII.get(X86::DWARF_LABEL)).addImm(ReadyLabelId); + BuildMI(MBB, MBBI, TII.get(X86::LABEL)).addImm(ReadyLabelId); MachineLocation FPDst(hasFP(MF) ? FramePtr : StackPtr); MachineLocation FPSrc(MachineLocation::VirtualFP); |