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());
lpm.add(createLoopSimplifyPass());
lpm.add(createLoopRotatePass());
lpm.add(createLCSSAPass());
// int threshold = UINT_MAX;
// int unrollCount = unroll_time;
// int allowPartial = 1;
lpm.add(createLoopUnrollPass(UINT_MAX,unroll_time,1));
// lpm.add(createInstructionNamerPass());
//lpm.add(createLoopRerollPass());
//lpm.add(new looptest());
lpm.run(*Mod);

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

By Chen YX
Best wishes to you

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