Even though InsertAtEndOfBasicBlock is an ugly hack it still deserves a proper name...
authorEvan Cheng <evan.cheng@apple.com>
Wed, 30 Jan 2008 18:18:23 +0000 (18:18 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 30 Jan 2008 18:18:23 +0000 (18:18 +0000)
instruction at the end.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46562 91177308-0d34-0410-b5e6-96231b3b80d8

13 files changed:
include/llvm/Target/TargetLowering.h
lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/ARM/ARMISelLowering.h
lib/Target/CellSPU/SPUISelLowering.cpp
lib/Target/CellSPU/SPUISelLowering.h
lib/Target/IA64/IA64ISelLowering.h
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCISelLowering.h
lib/Target/Sparc/SparcISelDAGToDAG.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h

index 40b45529da68e214f1f3f23da7c689db41d18f9b..9094e374c8dd243331eea2851febf870b5350810 100644 (file)
@@ -1022,13 +1022,13 @@ public:
   // Scheduler hooks
   //
   
-  // InsertAtEndOfBasicBlock - This method should be implemented by targets that
-  // mark instructions with the 'usesCustomDAGSchedInserter' flag.  These
+  // EmitInstrWithCustomInserter - This method should be implemented by targets
+  // that mark instructions with the 'usesCustomDAGSchedInserter' flag.  These
   // instructions are special in various ways, which require special support to
   // insert.  The specified MachineInstr is created but not inserted into any
   // basic blocks, and the scheduler passes ownership of it to this method.
-  virtual MachineBasicBlock *InsertAtEndOfBasicBlock(MachineInstr *MI,
-                                                     MachineBasicBlock *MBB);
+  virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
+                                                         MachineBasicBlock *MBB);
 
   //===--------------------------------------------------------------------===//
   // Addressing mode description hooks (used by LSR etc).
index 293d023381184b118528f7fb3e780696f58638a0..543a9fb9dce34b1adc68143a85589d4429cbb606 100644 (file)
@@ -715,7 +715,7 @@ void ScheduleDAG::EmitNode(SDNode *Node, unsigned InstanceNo,
     } else {
       // Insert this instruction into the end of the basic block, potentially
       // taking some custom action.
-      BB = DAG.getTargetLoweringInfo().InsertAtEndOfBasicBlock(MI, BB);
+      BB = DAG.getTargetLoweringInfo().EmitInstrWithCustomInserter(MI, BB);
     }
 
     // Additional results must be an physical register def.
index 406011ac9165d51be5f021b3a6cd0d039938016c..87b27401af079b1d5bf0982cbe3e5f880d507cd3 100644 (file)
@@ -3855,16 +3855,16 @@ void SelectionDAGLowering::visitFree(FreeInst &I) {
   DAG.setRoot(Result.second);
 }
 
-// InsertAtEndOfBasicBlock - This method should be implemented by targets that
-// mark instructions with the 'usesCustomDAGSchedInserter' flag.  These
+// EmitInstrWithCustomInserter - This method should be implemented by targets
+// that mark instructions with the 'usesCustomDAGSchedInserter' flag.  These
 // instructions are special in various ways, which require special support to
 // insert.  The specified MachineInstr is created but not inserted into any
 // basic blocks, and the scheduler passes ownership of it to this method.
-MachineBasicBlock *TargetLowering::InsertAtEndOfBasicBlock(MachineInstr *MI,
+MachineBasicBlock *TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
                                                        MachineBasicBlock *MBB) {
   cerr << "If a target marks an instruction with "
        << "'usesCustomDAGSchedInserter', it must implement "
-       << "TargetLowering::InsertAtEndOfBasicBlock!\n";
+       << "TargetLowering::EmitInstrWithCustomInserter!\n";
   abort();
   return 0;  
 }
index a0278a4b62f152cb2b5baa4ac2fbd71e9d6d3730..dfe3bec9a585aa3aaf9588c8b6e1495ed57d3026 100644 (file)
@@ -1453,7 +1453,7 @@ SDNode *ARMTargetLowering::ExpandOperationResult(SDNode *N, SelectionDAG &DAG) {
 //===----------------------------------------------------------------------===//
 
 MachineBasicBlock *
-ARMTargetLowering::InsertAtEndOfBasicBlock(MachineInstr *MI,
+ARMTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
                                            MachineBasicBlock *BB) {
   const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
   switch (MI->getOpcode()) {
index e633a60cb9fd91541f33a98ede34b0f2a32b16fa..7327587e511a81d019e841f54719df4aa861836c 100644 (file)
@@ -82,7 +82,7 @@ namespace llvm {
     
     virtual const char *getTargetNodeName(unsigned Opcode) const;
 
-    virtual MachineBasicBlock *InsertAtEndOfBasicBlock(MachineInstr *MI,
+    virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
                                                        MachineBasicBlock *MBB);
 
     /// isLegalAddressingMode - Return true if the addressing mode represented
index 407b8e6856f968b43ee514d3d59f554bf78d5f80..7dd9b60c2bc133d8f988aa1d3e60215ec32ef754 100644 (file)
@@ -2534,17 +2534,6 @@ SPUTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG)
   return SDOperand();
 }
 
-//===----------------------------------------------------------------------===//
-//  Other Lowering Code
-//===----------------------------------------------------------------------===//
-
-MachineBasicBlock *
-SPUTargetLowering::InsertAtEndOfBasicBlock(MachineInstr *MI,
-                                           MachineBasicBlock *BB)
-{
-  return BB;
-}
-
 //===----------------------------------------------------------------------===//
 // Target Optimization Hooks
 //===----------------------------------------------------------------------===//
index 3ac768ae40a353ae1ffa5efefffb5870e70c0c8d..d09848e4066edf0782cae9181e7a3b6272bcddb2 100644 (file)
@@ -114,9 +114,6 @@ namespace llvm {
                                                 const SelectionDAG &DAG,
                                                 unsigned Depth = 0) const;
 
-    virtual MachineBasicBlock *InsertAtEndOfBasicBlock(MachineInstr *MI,
-                                                       MachineBasicBlock *MBB);
-    
     ConstraintType getConstraintType(const std::string &ConstraintLetter) const;
 
     std::pair<unsigned, const TargetRegisterClass*> 
index 411eb393ee4fd3522b24d91fef24d781b35d6929..20724d24fb0c2460257c2d70c2b85c0c0607031f 100644 (file)
@@ -66,8 +66,6 @@ namespace llvm {
     /// (currently, only "ret void")
     virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG);
     
-// XXX    virtual MachineBasicBlock *InsertAtEndOfBasicBlock(MachineInstr *MI,
-// XXX                                                      MachineBasicBlock *MBB);
   };
 }
 
index 905236ab6e14a42b350568eedf64f20edc64adcc..0cc69fecec841c794d01cd205f79f5aeecd5e7f0 100644 (file)
@@ -3124,8 +3124,8 @@ SDNode *PPCTargetLowering::ExpandOperationResult(SDNode *N, SelectionDAG &DAG) {
 //===----------------------------------------------------------------------===//
 
 MachineBasicBlock *
-PPCTargetLowering::InsertAtEndOfBasicBlock(MachineInstr *MI,
-                                           MachineBasicBlock *BB) {
+PPCTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
+                                               MachineBasicBlock *BB) {
   const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
   assert((MI->getOpcode() == PPC::SELECT_CC_I4 ||
           MI->getOpcode() == PPC::SELECT_CC_I8 ||
index 361dc27b608859099536de92256583cb85e9795d..ae42aeb5bdd6f7ceb712de094b174a484dba9242 100644 (file)
@@ -260,8 +260,8 @@ namespace llvm {
                                                 const SelectionDAG &DAG,
                                                 unsigned Depth = 0) const;
 
-    virtual MachineBasicBlock *InsertAtEndOfBasicBlock(MachineInstr *MI,
-                                                       MachineBasicBlock *MBB);
+    virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
+                                                        MachineBasicBlock *MBB);
     
     ConstraintType getConstraintType(const std::string &Constraint) const;
     std::pair<unsigned, const TargetRegisterClass*> 
index 7c3e2a72204d39de5ee785b116c05f5db1f69432..f8dfbe3efaabd9459fd79662aa1b5f1adf3ceab4 100644 (file)
@@ -121,8 +121,8 @@ namespace {
       LowerCallTo(SDOperand Chain, const Type *RetTy, bool RetTyIsSigned, 
                   bool isVarArg, unsigned CC, bool isTailCall, SDOperand Callee,
                   ArgListTy &Args, SelectionDAG &DAG);
-    virtual MachineBasicBlock *InsertAtEndOfBasicBlock(MachineInstr *MI,
-                                                       MachineBasicBlock *MBB);
+    virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
+                                                        MachineBasicBlock *MBB);
     
     virtual const char *getTargetNodeName(unsigned Opcode) const;
   };
@@ -895,8 +895,8 @@ LowerOperation(SDOperand Op, SelectionDAG &DAG) {
 }
 
 MachineBasicBlock *
-SparcTargetLowering::InsertAtEndOfBasicBlock(MachineInstr *MI,
-                                             MachineBasicBlock *BB) {
+SparcTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
+                                                 MachineBasicBlock *BB) {
   const TargetInstrInfo &TII = *getTargetMachine().getInstrInfo();
   unsigned BROpcode;
   unsigned CC;
index df7ebeb90ca7fba60b3ae122f911c95f7344963a..af3d0e13818aacf027bce9f915111d11b33ccd3a 100644 (file)
@@ -5383,8 +5383,8 @@ bool X86TargetLowering::isVectorClearMaskLegal(std::vector<SDOperand> &BVOps,
 //===----------------------------------------------------------------------===//
 
 MachineBasicBlock *
-X86TargetLowering::InsertAtEndOfBasicBlock(MachineInstr *MI,
-                                           MachineBasicBlock *BB) {
+X86TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
+                                               MachineBasicBlock *BB) {
   const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
   switch (MI->getOpcode()) {
   default: assert(false && "Unexpected instr type to insert");
index b2b46469406bd26306892ce0c07597273506229f..3946e2edc1fec07b90016a6c6861fc74763778c7 100644 (file)
@@ -356,8 +356,8 @@ namespace llvm {
     
     virtual SDOperand PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
 
-    virtual MachineBasicBlock *InsertAtEndOfBasicBlock(MachineInstr *MI,
-                                                       MachineBasicBlock *MBB);
+    virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
+                                                        MachineBasicBlock *MBB);
 
     /// getTargetNodeName - This method returns the name of a target specific
     /// DAG node.