Make LABEL a builtin opcode.
authorJim Laskey <jlaskey@mac.com>
Fri, 26 Jan 2007 14:34:52 +0000 (14:34 +0000)
committerJim Laskey <jlaskey@mac.com>
Fri, 26 Jan 2007 14:34:52 +0000 (14:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33537 91177308-0d34-0410-b5e6-96231b3b80d8

31 files changed:
include/llvm/CodeGen/AsmPrinter.h
include/llvm/CodeGen/SelectionDAGNodes.h
include/llvm/Target/TargetInstrInfo.h
lib/CodeGen/AsmPrinter.cpp
lib/CodeGen/BranchFolding.cpp
lib/CodeGen/MachineDebugInfo.cpp
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/Target/ARM/ARMConstantIslandPass.cpp
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/ARM/ARMInstrInfo.cpp
lib/Target/ARM/ARMInstrInfo.h
lib/Target/ARM/ARMInstrInfo.td
lib/Target/Alpha/AlphaISelLowering.cpp
lib/Target/IA64/IA64ISelLowering.cpp
lib/Target/PowerPC/PPCBranchSelector.cpp
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCInstrInfo.h
lib/Target/PowerPC/PPCInstrInfo.td
lib/Target/PowerPC/PPCRegisterInfo.cpp
lib/Target/Sparc/SparcISelDAGToDAG.cpp
lib/Target/Target.td
lib/Target/TargetSelectionDAG.td
lib/Target/X86/X86CodeEmitter.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86InstrInfo.cpp
lib/Target/X86/X86InstrInfo.h
lib/Target/X86/X86InstrInfo.td
lib/Target/X86/X86RegisterInfo.cpp

index 76fc1ec580bcf82be3a0723e56e15d3c687e0914..88136c0eae0a62f16c36faee3392194b2ae09b93 100644 (file)
@@ -266,6 +266,10 @@ namespace llvm {
     /// instruction that is an inline asm.
     void printInlineAsm(const MachineInstr *MI) const;
     
+    /// printLabel - This method prints a local label used by debug and
+    /// exception handling tables.
+    void printLabel(const MachineInstr *MI) const;
+
     /// printBasicBlockLabel - This method prints the label for the specified
     /// MachineBasicBlock
     virtual void printBasicBlockLabel(const MachineBasicBlock *MBB,
index f7c7535eb6369be3a692d79812a2eb47eef869f1..670bb7c7abd8bed3cf6f22a9fb4e1f645ab24cba 100644 (file)
@@ -436,6 +436,13 @@ namespace ISD {
     //   Operand #2n+3: A TargetConstant, indicating if the reg is a use/def
     //   Operand #last: Optional, an incoming flag.
     INLINEASM,
+    
+    // LABEL - Represents a label in mid basic block used to track
+    // locations needed for debug and exception handling tables.  This node
+    // returns a chain.
+    //   Operand #0 : input chain.
+    //   Operand #1 : module unique number use to identify the label.
+    LABEL,
 
     // STACKSAVE - STACKSAVE has one operand, an input chain.  It produces a
     // value, the same type as the pointer type for the system, and an output
@@ -503,12 +510,6 @@ namespace ISD {
     // produces a token chain as output.
     DEBUG_LOC,
     
-    // DEBUG_LABEL - This node is used to mark a location in the code where a
-    // label should be generated for use by the debug information.  It takes a
-    // token chain as input and then a unique id (provided by MachineDebugInfo.)
-    // It produces a token chain as output.
-    DEBUG_LABEL,
-    
     // BUILTIN_OP_END - This must be the last enum value in this list.
     BUILTIN_OP_END
   };
index eb1dbce352a3a6596123f79bf240c286131041a2..e4b37c3bf04fb7b4d5f37eb951b7684a17d4c958 100644 (file)
@@ -166,7 +166,8 @@ public:
   // Invariant opcodes: All instruction sets have these as their low opcodes.
   enum { 
     PHI = 0,
-    INLINEASM = 1
+    INLINEASM = 1,
+    LABEL = 2
   };
 
   unsigned getNumOpcodes() const { return NumOpcodes; }
@@ -263,13 +264,6 @@ public:
     return get(Opcode).getOperandConstraint(OpNum, Constraint);
   }
 
-  /// 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 0;
-  }
-  
   /// Return true if the instruction is a register to register move
   /// and leave the source and dest operands in the passed parameters.
   virtual bool isMoveInstr(const MachineInstr& MI,
index 12a824c8ca7405330e7d8a7484cd758105e71aba..e2935804fc95ac84376b2a607ee188e33094c5fa 100644 (file)
@@ -1029,6 +1029,16 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const {
   O << "\n\t" << TAI->getInlineAsmEnd() << "\n";
 }
 
+/// printLabel - This method prints a local label used by debug and
+/// exception handling tables.
+void AsmPrinter::printLabel(const MachineInstr *MI) const {
+  if (AsmVerbose) O << "\n";
+  O << TAI->getPrivateGlobalPrefix()
+    << "debug_loc"
+    << MI->getOperand(0).getImmedValue()
+    << ":\n";
+}
+
 /// PrintAsmOperand - Print the specified operand of MI, an INLINEASM
 /// instruction, using the specified assembler variant.  Targets should
 /// overried this to format as appropriate.
index 69c6f4e62eaf14845a02236bd7f5350b6f7dd9f5..efc382bcfa569412384e03d1298f59403f117eeb 100644 (file)
@@ -74,16 +74,12 @@ void BranchFolder::RemoveDeadBlock(MachineBasicBlock *MBB) {
   while (!MBB->succ_empty())
     MBB->removeSuccessor(MBB->succ_end()-1);
   
-  // If there is DWARF info to active, check to see if there are any DWARF_LABEL
+  // If there is DWARF info to active, check to see if there are any LABEL
   // records in the basic block.  If so, unregister them from MachineDebugInfo.
   if (MDI && !MBB->empty()) {
-    unsigned DWARF_LABELOpc = TII->getDWARF_LABELOpcode();
-    assert(DWARF_LABELOpc &&
-           "Target supports dwarf but didn't implement getDWARF_LABELOpcode!");
-    
     for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end();
          I != E; ++I) {
-      if ((unsigned)I->getOpcode() == DWARF_LABELOpc) {
+      if ((unsigned)I->getOpcode() == TargetInstrInfo::LABEL) {
         // The label ID # is always operand #0, an immediate.
         MDI->InvalidateLabel(I->getOperand(0).getImm());
       }
index 2ad1ba0ada99acd9fa8deb27a1b3cd10c202ebac..45e7fa2a6b163c29ae0c6801949e0d9efb947fe5 100644 (file)
@@ -1649,9 +1649,6 @@ bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) {
   // Get target instruction info.
   const TargetInstrInfo *TII = MF.getTarget().getInstrInfo();
   if (!TII) return false;
-  // Get target version of the debug label opcode.
-  unsigned DWARF_LABELOpc = TII->getDWARF_LABELOpcode();
-  if (!DWARF_LABELOpc) return false;
   
   // Track if change is made.
   bool MadeChange = false;
@@ -1664,7 +1661,7 @@ bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) {
     // Iterate through instructions.
     for (MachineBasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ) {
       // Is it a debug label.
-      if ((unsigned)I->getOpcode() == DWARF_LABELOpc) {
+      if ((unsigned)I->getOpcode() == TargetInstrInfo::LABEL) {
         // The label ID # is always operand #0, an immediate.
         unsigned NextLabel = I->getOperand(0).getImm();
         
index c8804e907ac72944fe25f258f0216561b5e1603e..3a8fe7a5e6a10bba6ff905c6848027336be971d5 100644 (file)
@@ -737,9 +737,9 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
     case TargetLowering::Expand: {
       MachineDebugInfo *DebugInfo = DAG.getMachineDebugInfo();
       bool useDEBUG_LOC = TLI.isOperationLegal(ISD::DEBUG_LOC, MVT::Other);
-      bool useDEBUG_LABEL = TLI.isOperationLegal(ISD::DEBUG_LABEL, MVT::Other);
+      bool useLABEL = TLI.isOperationLegal(ISD::LABEL, MVT::Other);
       
-      if (DebugInfo && (useDEBUG_LOC || useDEBUG_LABEL)) {
+      if (DebugInfo && (useDEBUG_LOC || useLABEL)) {
         const std::string &FName =
           cast<StringSDNode>(Node->getOperand(3))->getValue();
         const std::string &DirName = 
@@ -761,7 +761,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
           unsigned Col = cast<ConstantSDNode>(ColOp)->getValue();
           unsigned ID = DebugInfo->RecordLabel(Line, Col, SrcFile);
           Ops.push_back(DAG.getConstant(ID, MVT::i32));
-          Result = DAG.getNode(ISD::DEBUG_LABEL, MVT::Other,&Ops[0],Ops.size());
+          Result = DAG.getNode(ISD::LABEL, MVT::Other,&Ops[0],Ops.size());
         }
       } else {
         Result = Tmp1;  // chain
@@ -803,9 +803,9 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
     }
     break;    
 
-  case ISD::DEBUG_LABEL:
-    assert(Node->getNumOperands() == 2 && "Invalid DEBUG_LABEL node!");
-    switch (TLI.getOperationAction(ISD::DEBUG_LABEL, MVT::Other)) {
+  case ISD::LABEL:
+    assert(Node->getNumOperands() == 2 && "Invalid LABEL node!");
+    switch (TLI.getOperationAction(ISD::LABEL, MVT::Other)) {
     default: assert(0 && "This action is not supported yet!");
     case TargetLowering::Legal:
       Tmp1 = LegalizeOp(Node->getOperand(0));  // Legalize the chain.
index eeea70d2977d2c805450d239758f9c53f3b54935..33227ad4e072ea5ffec5271893e96d21542a6400 100644 (file)
@@ -452,6 +452,7 @@ void ScheduleDAG::EmitNode(SDNode *Node,
       assert(0 && "This target-independent node should have been selected!");
     case ISD::EntryToken: // fall thru
     case ISD::TokenFactor:
+    case ISD::LABEL:
       break;
     case ISD::CopyToReg: {
       unsigned InReg;
index 5f92df3f2d54d59baf6b64ab073292a035290961..97fb8c5a049cc9e07397010c9fa45747960a368b 100644 (file)
@@ -2691,6 +2691,7 @@ const char *SDNode::getOperationName(const SelectionDAG *G) const {
   case ISD::UNDEF:         return "undef";
   case ISD::MERGE_VALUES:  return "mergevalues";
   case ISD::INLINEASM:     return "inlineasm";
+  case ISD::LABEL:         return "label";
   case ISD::HANDLENODE:    return "handlenode";
   case ISD::FORMAL_ARGUMENTS: return "formal_arguments";
   case ISD::CALL:          return "call";
@@ -2811,7 +2812,6 @@ const char *SDNode::getOperationName(const SelectionDAG *G) const {
   // Debug info
   case ISD::LOCATION: return "location";
   case ISD::DEBUG_LOC: return "debug_loc";
-  case ISD::DEBUG_LABEL: return "debug_label";
 
   case ISD::CONDCODE:
     switch (cast<CondCodeSDNode>(this)->get()) {
index bf163270b5463007b39dc2e34a907e07fe6b64cb..748dae8789fa683f5a4543d2827cd4734c337884 100644 (file)
@@ -1980,7 +1980,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
     DbgRegionStartInst &RSI = cast<DbgRegionStartInst>(I);
     if (DebugInfo && RSI.getContext() && DebugInfo->Verify(RSI.getContext())) {
       unsigned LabelID = DebugInfo->RecordRegionStart(RSI.getContext());
-      DAG.setRoot(DAG.getNode(ISD::DEBUG_LABEL, MVT::Other, getRoot(),
+      DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other, getRoot(),
                               DAG.getConstant(LabelID, MVT::i32)));
     }
 
@@ -1991,7 +1991,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
     DbgRegionEndInst &REI = cast<DbgRegionEndInst>(I);
     if (DebugInfo && REI.getContext() && DebugInfo->Verify(REI.getContext())) {
       unsigned LabelID = DebugInfo->RecordRegionEnd(REI.getContext());
-      DAG.setRoot(DAG.getNode(ISD::DEBUG_LABEL, MVT::Other,
+      DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other,
                               getRoot(), DAG.getConstant(LabelID, MVT::i32)));
     }
 
@@ -2003,7 +2003,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
     if (DebugInfo && FSI.getSubprogram() &&
         DebugInfo->Verify(FSI.getSubprogram())) {
       unsigned LabelID = DebugInfo->RecordRegionStart(FSI.getSubprogram());
-      DAG.setRoot(DAG.getNode(ISD::DEBUG_LABEL, MVT::Other,
+      DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other,
                   getRoot(), DAG.getConstant(LabelID, MVT::i32)));
     }
 
index db50bde3849bddccc8b2655fe33a90fd00829d5d..26119059fed2d9ff0574f30d912f2027cdb29ffe 100644 (file)
@@ -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.
index 031cd0a2f556197d3c655e481cb0591dc6c5806b..594a48e788e8a18b90c2f7ee555e07bc142f8656 100644 (file)
@@ -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);
index b5425fec8aa328ed6fde5db82277a8a5f59af987..86d6614df3fd40dfa8369004465752b1f1d77670 100644 (file)
@@ -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;
 }
index 0208121f142abfb0d4719fe0d975b6ef292967e9..db52a2dbc776a345e5a62cb3b4b908ba951f0be6 100644 (file)
@@ -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.
   ///
index 4762a0e8d9cfa71a3a95603d0169e8c75c102958..63aea02d6818985e170377b80b24510a7bf5dfd4 100644 (file)
@@ -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))]>;
index 80c40cdbd1d3b1b3a8664828922b34ec72628a60..f0e5be6a0c99a3b98ce7fad2adc6facf54432dd5 100644 (file)
@@ -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); 
index 6fddb37367569a54496854f4d91f38ac737ca8b7..2d14a2bc5ffe483cb0007f2839b3dc31060a1cec 100644 (file)
@@ -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);
index e8274f3b9e531e29814405b7a1cfa8c0b4b359c8..2cd8325ce3d598c13f9e5d83e9f5a1fa0028002f 100644 (file)
@@ -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
   }
index 5fb567b270af3a8bb57c14255bf948d34acc7c81..097ca91a30b237c76a6da4de85579b646799f173 100644 (file)
@@ -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.
index c519d622c500d4d201868b1ffad182d9550c4a8d..9005963df6627f41bbffeb13713dc8b182af8237 100644 (file)
@@ -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.
   //
index c405b2b9d4bcd060c8b27e16cd39792cd264c39a..7b03f92eef0658c1be3f843a4c1543631ed3cac3 100644 (file)
@@ -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
 //
index 7e5d693c36dd582d814fa544e5fe93d0a014e4aa..75c92615ea5a8bc6a1dd4072a3564f991c040f35 100644 (file)
@@ -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));
index 43059ea9ee56c496be9c3002ea5479b30d756a6a..f361b4670a54f55502f5d25010b551a787ca3ccf 100644 (file)
@@ -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);
index 5f8d2e260bf11d0f489fc4d654e8a4975fd59ac5..96e4e2837541f54dfd52ad167a387299e13396b5 100644 (file)
@@ -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
index 989f1e26ac9ed9209ad40210855332e23ab85048..17c0ddd12f3e02809df4f244605bd00c578fa6c6 100644 (file)
@@ -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]>;
-
 
 
index fa3cd57b8a32726c7faf386714097b1deb62dda6..d27e647e407663a130ab5642584ecc1d88dd3d9b 100644 (file)
@@ -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:
index 0c2c4e6c04c1aa46bf40fe77120f1bf036bdac0c..9f9fb7248e6a9de15af9195ff2a8eed9be60376c 100644 (file)
@@ -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);
index 452eb1f2cff5ab92a4ee3e3035c1608954936c14..87f04b80ba36a73646fcf08193f0ade1666d3701 100644 (file)
@@ -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 {
index 4e79c71540f2922f82ad5f2971a3f56da23e4c84..b753a88f1d08c6ce74aaa00bae1e0525260ba22e 100644 (file)
@@ -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
index 8518e67337a6ac5658b5488da430db4532e76636..50bef5676c21841cf7698e3c1c04bad805923702 100644 (file)
@@ -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
 //===----------------------------------------------------------------------===//
index c47d1c798224c6b481ef69b4caa7263df8dc6ee1..4b13dac63c95fb18de0ed3d89620545046fec3d8 100644 (file)
@@ -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);