I would delete the Loop. I used the following code.<br><br>    cout << "begin to delete loop" << endl;<br>    for (Loop::block_iterator bi = L->block_begin(), bi2; bi != L->block_end(); bi = bi2) {<br>
        bi2 = bi;<br>        bi2++;<br>        BasicBlock * BB = *bi;<br>        for (BasicBlock::iterator ii = BB->begin(), ii2; ii != BB->end(); ii= ii2) {<br>            ii2 = ii;<br>            ii2++;<br>            Instruction *inst = ii;<br>
            inst->eraseFromParent();<br>        }<br>        BB->eraseFromParent();<br>    }<br><br>But I get the following error:<br><br>Use still stuck around after Def is destroyed:  %t1 = icmp sle i32 %t0, 9<br>
opt: /home/llvm/src/lib/VMCore/Value.cpp:75: virtual llvm::Value::~Value(): Assertion `use_empty() && "Uses remain when a value is destroyed!"' failed.<br>0  opt 0x0848e569<br>Stack dump:<br><br><br>
What suggestions do you have for solve this problem?<br>