Skip to content

llc failed with MIPS architecture #2915

@llvmbot

Description

@llvmbot
Bugzilla Link 2543
Resolution FIXED
Resolved on Oct 30, 2008 14:52
Version 2.3
OS Linux
Attachments A simple .c file, The generated bitcode
Reporter LLVM Bugzilla Contributor
CC @bcardosolopes

Extended Description

When I compile the simple attached C file, llc seems to enter an infinite loop with -march=mips.

Here after are the command I write:

llvm-gcc -emit-llvm -c main.c -o main.bc
llc -march=mips -debug main.bc -f -o main.mips.s

I identify that the infinite loop is the while() in the LatencyPriorityQueue::CalculatePriorities() method (file CodeGen/SelectionDAG/ScheduleDAGList.cpp). Some SUnit are added continuously to the WorkList ...

I attach the main.c and main.bc files.

void LatencyPriorityQueue::CalculatePriorities() {
Latencies.assign(SUnits->size(), -1);
NumNodesSolelyBlocking.assign(SUnits->size(), 0);

// For each node, calculate the maximal path from the node to the exit.
std::vector<std::pair<const SUnit*, unsigned> > WorkList;
for (unsigned i = 0, e = SUnits->size(); i != e; ++i) {
const SUnit *SU = &(*SUnits)[i];
if (SU->Succs.empty())
WorkList.push_back(std::make_pair(SU, 0U));
}

while (!WorkList.empty()) {
const SUnit *SU = WorkList.back().first;
unsigned SuccLat = WorkList.back().second;
WorkList.pop_back();
int &Latency = Latencies[SU->NodeNum];
if (Latency == -1 || (SU->Latency + SuccLat) > (unsigned)Latency) {
Latency = SU->Latency + SuccLat;
for (SUnit::const_pred_iterator I = SU->Preds.begin(),E = SU->Preds.end();
I != E; ++I)
WorkList.push_back(std::make_pair(I->Dep, Latency));
}
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions