diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-08-26 20:54:47 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-08-26 20:54:47 +0000 |
| commit | 13d7c252e569dd8d842134e1b22504aefa647e1a (patch) | |
| tree | 87ea3feba8ada6115052561a66908c84549f1ea2 /llvm/lib/CodeGen/SelectionDAG | |
| parent | 17c28fa36bb63a32c65a00b182e1c268e18eb569 (diff) | |
| download | bcm5719-llvm-13d7c252e569dd8d842134e1b22504aefa647e1a.tar.gz bcm5719-llvm-13d7c252e569dd8d842134e1b22504aefa647e1a.zip | |
Call the InsertAtEndOfBasicBlock hook if the usesCustomDAGSchedInserter
flag is set on an instruction.
llvm-svn: 23098
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | 9 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 14 |
2 files changed, 22 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp index 33c9167f69b..dc3996bbfe1 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp @@ -20,6 +20,7 @@ #include "llvm/CodeGen/SSARegMap.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetInstrInfo.h" +#include "llvm/Target/TargetLowering.h" #include "llvm/Support/CommandLine.h" using namespace llvm; @@ -166,7 +167,13 @@ unsigned SimpleSched::Emit(SDOperand Op) { } // Now that we have emitted all operands, emit this instruction itself. - BB->insert(BB->end(), MI); + if ((II.Flags & M_USES_CUSTOM_DAG_SCHED_INSERTION) == 0) { + BB->insert(BB->end(), MI); + } else { + // Insert this instruction into the end of the basic block, potentially + // taking some custom action. + BB = DAG.getTargetLoweringInfo().InsertAtEndOfBasicBlock(MI, BB); + } } else { switch (Op.getOpcode()) { default: diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 227d34e1c47..7b8d7c549c9 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -855,6 +855,20 @@ 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 +// 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 *MBB) { + std::cerr << "If a target marks an instruction with " + "'usesCustomDAGSchedInserter', it must implement " + "TargetLowering::InsertAtEndOfBasicBlock!\n"; + abort(); + return 0; +} + SDOperand TargetLowering::LowerVAStart(SDOperand Chain, SDOperand VAListP, Value *VAListV, SelectionDAG &DAG) { |

