Loop unroll error

Dear llvm developers:
I think llvm is a powerful project. But there is an error trouble me.
When I use OPT tool to inline other function, then use pass manager to unroll loop. The inline option is successful, but when unroll loop at ten times the result is false.
But I do not want to promote the memory to register, so I just interpret the ll file which create by clang.
Can you help me how to deal with this problem?

The follow will show my code:
llvm::legacy::PassManager lpm;
// lpm.add(createPromoteMemoryToRegisterPass());
// int threshold = UINT_MAX;
// int unrollCount = unroll_time;
// int allowPartial = 1;
// lpm.add(createInstructionNamerPass());
//lpm.add(new looptest());

func = Mod->getFunction(“main”);

By Chen YX
Best wishes to you

gcd_2_true-unreach-call_true-no-overflowinline.ll (6.67 KB)