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 | 025c39bf36b6bc2f35a5544338de6cf96fa511a9 (patch) | |
tree | 6451248fbea5b082f7e60903c005a3e32b8d374c /lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | |
parent | 8fae46675dbd636f68fde437263d7e6fb03c482a (diff) |
Call the InsertAtEndOfBasicBlock hook if the usesCustomDAGSchedInserter
flag is set on an instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23098 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/ScheduleDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp index 33c9167f69..dc3996bbfe 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp +++ b/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: |