Assertion failed !!

HI I am try to run my new pass and it is giving the following error message while running:
opt: loop_graph_new.cpp:265: void ::LoopGraphAnalysisPass::AddDataEdges(llvm::Loop , unsigned int): Assertion `loopGraph != graphs.end()’ failed.
0 opt 0x000000000193137e llvm::sys::PrintStackTrace(_IO_FILE
) + 46
1 opt 0x000000000193163b
2 opt 0x00000000019318ae
3 libpthread.so.0 0x00007fc5c4040340
4 libc.so.6 0x00007fc5c3054cc9 gsignal + 57
5 libc.so.6 0x00007fc5c30580d8 abort + 328
6 libc.so.6 0x00007fc5c304db86
7 libc.so.6 0x00007fc5c304dc32
8 loop_graph_analysis_abc.so 0x00007fc5c2e1796f
9 loop_graph_analysis_abc.so 0x00007fc5c2e17873
10 loop_graph_analysis_abc.so 0x00007fc5c2e177ad
11 opt 0x0000000001898c5b llvm::FPPassManager::runOnFunction(llvm::Function&) + 427
12 opt 0x0000000001898f68 llvm::FPPassManager::runOnModule(llvm::Module&) + 104
13 opt 0x000000000189962a
14 opt 0x000000000189921e llvm::legacy::PassManagerImpl::run(llvm::Module&) + 302
15 opt 0x0000000001899ad1 llvm::legacy::PassManager::run(llvm::Module&) + 33
16 opt 0x0000000000657ca2 main + 6706
17 libc.so.6 0x00007fc5c303fec5 __libc_start_main + 245
18 opt 0x0000000000649219
Stack dump:
0. Program arguments: opt -load /home/manideepa/Desktop/research/compiler/llvm-3.4/Debug+Asserts/lib/loop_graph_analysis_abc.so -loop-graph-analysis-abc matrix.bc -o newmat.txt

  1. Running pass ‘Function Pass Manager’ on module ‘matrix.bc’.
  2. Running pass ‘form program graphs and analyze’ on function ‘@main
    Aborted (core dumped)

Is this error is due to loopID.

The error is in the following AddDataEdges function which is being called from ProcessLoop() :

bool ProcessLoop(Loop* L/, ProfileInfo& PI/)
{
//ENTRY_POINT(“ProcessLoop”);
printf(“ProcessLoop\n”);
for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
ProcessLoop(I/, PI*/);

map <unsigned int, double>::iterator topLoopIter = topLoops.find(loopID);

//introduce data dependence edges into graph
AddDataEdges(L, loopID);

void AddDataEdges (Loop* L, unsigned int id)
{
//ENTRY_POINT(“AddDataEdges”);
printf(“AddDataEdges\n”);
//get loop graph
map <unsigned int, clust_graph>::iterator loopGraph = graphs.find (id);
assert (loopGraph != graphs.end());

//for each node
for (map<Value*, clust_node>::iterator nodeIter = loopGraph->second.begin(); nodeIter != loopGraph->second.end(); nodeIter ++)

Please help.

Thanks,

Manideepa