任何人都可以告诉我如何永久删除IR的指令。当我尝试使用以下代码删除mul指令时,我得到一个StackDump:
Instruction *mul = BinaryOperator::CreateMul(op1,op1,"mul",tmp); //Creating new mul instruction
I2 = cast<Instruction>(i); //i is an Instruction iterator.
I2->replaceAllUsesWith(mul);
I2->eraseFromParent(); //Getting StackDump for this instruction