Very minor cleanups

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3271 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2002-08-09 18:55:18 +00:00
parent 44ac659bc5
commit b0cfa6dfec
2 changed files with 30 additions and 46 deletions

View File

@@ -1,16 +1,10 @@
// $Id$ //===- SchedGraph.cpp - Scheduling Graph Implementation -------------------===//
//*************************************************************************** //
// File: // Scheduling graph based on SSA graph plus extra dependence edges capturing
// SchedGraph.cpp // dependences due to machine resources (machine registers, CC registers, and
// // any others).
// Purpose: //
// Scheduling graph based on SSA graph plus extra dependence edges //===----------------------------------------------------------------------===//
// capturing dependences due to machine resources (machine registers,
// CC registers, and any others).
//
// History:
// 7/20/01 - Vikram Adve - Created
//**************************************************************************/
#include "SchedGraph.h" #include "SchedGraph.h"
#include "llvm/CodeGen/InstrSelection.h" #include "llvm/CodeGen/InstrSelection.h"
@@ -18,12 +12,10 @@
#include "llvm/CodeGen/MachineCodeForBasicBlock.h" #include "llvm/CodeGen/MachineCodeForBasicBlock.h"
#include "llvm/Target/MachineRegInfo.h" #include "llvm/Target/MachineRegInfo.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
#include "llvm/BasicBlock.h"
#include "llvm/Function.h" #include "llvm/Function.h"
#include "llvm/iOther.h" #include "llvm/iOther.h"
#include "Support/StringExtras.h" #include "Support/StringExtras.h"
#include "Support/STLExtras.h" #include "Support/STLExtras.h"
#include <iostream>
using std::vector; using std::vector;
using std::pair; using std::pair;
@@ -356,21 +348,21 @@ SchedGraph::addCDEdges(const TerminatorInst* term,
if (first == termMvec.size()) if (first == termMvec.size())
return; return;
SchedGraphNode* firstBrNode = this->getGraphNodeForInstr(termMvec[first]); SchedGraphNode* firstBrNode = getGraphNodeForInstr(termMvec[first]);
// Add CD edges from each instruction in the sequence to the // Add CD edges from each instruction in the sequence to the
// *last preceding* branch instr. in the sequence // *last preceding* branch instr. in the sequence
// Use a latency of 0 because we only need to prevent out-of-order issue. // Use a latency of 0 because we only need to prevent out-of-order issue.
// //
for (int i = (int) termMvec.size()-1; i > (int) first; i--) for (unsigned i = termMvec.size(); i > first+1; --i)
{ {
SchedGraphNode* toNode = this->getGraphNodeForInstr(termMvec[i]); SchedGraphNode* toNode = getGraphNodeForInstr(termMvec[i-1]);
assert(toNode && "No node for instr generated for branch?"); assert(toNode && "No node for instr generated for branch?");
for (int j = i-1; j >= 0; j--) for (unsigned j = i-1; j != 0; --j)
if (mii.isBranch(termMvec[j]->getOpCode())) if (mii.isBranch(termMvec[j-1]->getOpCode()))
{ {
SchedGraphNode* brNode = this->getGraphNodeForInstr(termMvec[j]); SchedGraphNode* brNode = getGraphNodeForInstr(termMvec[j-1]);
assert(brNode && "No node for instr generated for branch?"); assert(brNode && "No node for instr generated for branch?");
(void) new SchedGraphEdge(brNode, toNode, SchedGraphEdge::CtrlDep, (void) new SchedGraphEdge(brNode, toNode, SchedGraphEdge::CtrlDep,
SchedGraphEdge::NonDataDep, 0); SchedGraphEdge::NonDataDep, 0);
@@ -381,9 +373,9 @@ SchedGraph::addCDEdges(const TerminatorInst* term,
// Add CD edges from each instruction preceding the first branch // Add CD edges from each instruction preceding the first branch
// to the first branch. Use a latency of 0 as above. // to the first branch. Use a latency of 0 as above.
// //
for (int i = first-1; i >= 0; i--) for (unsigned i = first; i != 0; --i)
{ {
SchedGraphNode* fromNode = this->getGraphNodeForInstr(termMvec[i]); SchedGraphNode* fromNode = getGraphNodeForInstr(termMvec[i-1]);
assert(fromNode && "No node for instr generated for branch?"); assert(fromNode && "No node for instr generated for branch?");
(void) new SchedGraphEdge(fromNode, firstBrNode, SchedGraphEdge::CtrlDep, (void) new SchedGraphEdge(fromNode, firstBrNode, SchedGraphEdge::CtrlDep,
SchedGraphEdge::NonDataDep, 0); SchedGraphEdge::NonDataDep, 0);

View File

@@ -1,16 +1,10 @@
// $Id$ //===- SchedGraph.cpp - Scheduling Graph Implementation -------------------===//
//*************************************************************************** //
// File: // Scheduling graph based on SSA graph plus extra dependence edges capturing
// SchedGraph.cpp // dependences due to machine resources (machine registers, CC registers, and
// // any others).
// Purpose: //
// Scheduling graph based on SSA graph plus extra dependence edges //===----------------------------------------------------------------------===//
// capturing dependences due to machine resources (machine registers,
// CC registers, and any others).
//
// History:
// 7/20/01 - Vikram Adve - Created
//**************************************************************************/
#include "SchedGraph.h" #include "SchedGraph.h"
#include "llvm/CodeGen/InstrSelection.h" #include "llvm/CodeGen/InstrSelection.h"
@@ -18,12 +12,10 @@
#include "llvm/CodeGen/MachineCodeForBasicBlock.h" #include "llvm/CodeGen/MachineCodeForBasicBlock.h"
#include "llvm/Target/MachineRegInfo.h" #include "llvm/Target/MachineRegInfo.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
#include "llvm/BasicBlock.h"
#include "llvm/Function.h" #include "llvm/Function.h"
#include "llvm/iOther.h" #include "llvm/iOther.h"
#include "Support/StringExtras.h" #include "Support/StringExtras.h"
#include "Support/STLExtras.h" #include "Support/STLExtras.h"
#include <iostream>
using std::vector; using std::vector;
using std::pair; using std::pair;
@@ -356,21 +348,21 @@ SchedGraph::addCDEdges(const TerminatorInst* term,
if (first == termMvec.size()) if (first == termMvec.size())
return; return;
SchedGraphNode* firstBrNode = this->getGraphNodeForInstr(termMvec[first]); SchedGraphNode* firstBrNode = getGraphNodeForInstr(termMvec[first]);
// Add CD edges from each instruction in the sequence to the // Add CD edges from each instruction in the sequence to the
// *last preceding* branch instr. in the sequence // *last preceding* branch instr. in the sequence
// Use a latency of 0 because we only need to prevent out-of-order issue. // Use a latency of 0 because we only need to prevent out-of-order issue.
// //
for (int i = (int) termMvec.size()-1; i > (int) first; i--) for (unsigned i = termMvec.size(); i > first+1; --i)
{ {
SchedGraphNode* toNode = this->getGraphNodeForInstr(termMvec[i]); SchedGraphNode* toNode = getGraphNodeForInstr(termMvec[i-1]);
assert(toNode && "No node for instr generated for branch?"); assert(toNode && "No node for instr generated for branch?");
for (int j = i-1; j >= 0; j--) for (unsigned j = i-1; j != 0; --j)
if (mii.isBranch(termMvec[j]->getOpCode())) if (mii.isBranch(termMvec[j-1]->getOpCode()))
{ {
SchedGraphNode* brNode = this->getGraphNodeForInstr(termMvec[j]); SchedGraphNode* brNode = getGraphNodeForInstr(termMvec[j-1]);
assert(brNode && "No node for instr generated for branch?"); assert(brNode && "No node for instr generated for branch?");
(void) new SchedGraphEdge(brNode, toNode, SchedGraphEdge::CtrlDep, (void) new SchedGraphEdge(brNode, toNode, SchedGraphEdge::CtrlDep,
SchedGraphEdge::NonDataDep, 0); SchedGraphEdge::NonDataDep, 0);
@@ -381,9 +373,9 @@ SchedGraph::addCDEdges(const TerminatorInst* term,
// Add CD edges from each instruction preceding the first branch // Add CD edges from each instruction preceding the first branch
// to the first branch. Use a latency of 0 as above. // to the first branch. Use a latency of 0 as above.
// //
for (int i = first-1; i >= 0; i--) for (unsigned i = first; i != 0; --i)
{ {
SchedGraphNode* fromNode = this->getGraphNodeForInstr(termMvec[i]); SchedGraphNode* fromNode = getGraphNodeForInstr(termMvec[i-1]);
assert(fromNode && "No node for instr generated for branch?"); assert(fromNode && "No node for instr generated for branch?");
(void) new SchedGraphEdge(fromNode, firstBrNode, SchedGraphEdge::CtrlDep, (void) new SchedGraphEdge(fromNode, firstBrNode, SchedGraphEdge::CtrlDep,
SchedGraphEdge::NonDataDep, 0); SchedGraphEdge::NonDataDep, 0);