From 420025b04f4ca81ea1fa29a6ab995864a2dce7b6 Mon Sep 17 00:00:00 2001 From: Tanya Lattner Date: Sun, 10 Oct 2004 22:44:35 +0000 Subject: Added debug information. Fixed several bugs in the reconstruct loop function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16895 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/ModuloScheduling/MSSchedule.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'lib/CodeGen/ModuloScheduling/MSSchedule.cpp') diff --git a/lib/CodeGen/ModuloScheduling/MSSchedule.cpp b/lib/CodeGen/ModuloScheduling/MSSchedule.cpp index b8bbccf8be..4ce85e4949 100644 --- a/lib/CodeGen/ModuloScheduling/MSSchedule.cpp +++ b/lib/CodeGen/ModuloScheduling/MSSchedule.cpp @@ -15,6 +15,7 @@ #include "MSSchedule.h" #include "llvm/Support/Debug.h" #include "llvm/Target/TargetSchedInfo.h" +#include "../../Target/SparcV9/SparcV9Internals.h" using namespace llvm; @@ -134,6 +135,7 @@ bool MSSchedule::resourcesFree(MSchedGraphNode *node, int cycle) { bool MSSchedule::constructKernel(int II) { MSchedGraphNode *branchNode = 0; + MSchedGraphNode *branchANode = 0; int stageNum = (schedule.rbegin()->first)/ II; DEBUG(std::cerr << "Number of Stages: " << stageNum << "\n"); @@ -146,7 +148,10 @@ bool MSSchedule::constructKernel(int II) { E = schedule[i].end(); I != E; ++I) { //Check if its a branch if((*I)->isBranch()) { - branchNode = *I; + if((*I)->getInst()->getOpcode() == V9::BA) + branchANode = *I; + else + branchNode = *I; assert(count == 0 && "Branch can not be from a previous iteration"); } else @@ -160,7 +165,16 @@ bool MSSchedule::constructKernel(int II) { //Add Branch to the end kernel.push_back(std::make_pair(branchNode, 0)); - + + //Add Branch Always to the end + kernel.push_back(std::make_pair(branchANode, 0)); + + + if(stageNum > 0) + maxStage = stageNum; + else + maxStage = 0; + return true; } -- cgit v1.2.3-18-g5258