[clang] [llvm] [SimplifyCFG] Not folding branch in loop header with constant iterations (PR #74268)

via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 4 04:09:00 PST 2023


xiangzh1 wrote:

> LoopUnroll supports upper bound unrolling. Why is it not working in this case?
for example:
#program unroll
for (int I = 0; I < LoopCount; ++I) { // ConstNum > 1
if (Cond2) {
break;
}
xxx loop body;
}

After the branches fodling, the old loop condition  "I < LoopCount" changed/disapeared, I think unroll can not make sure the "upper bound"

https://github.com/llvm/llvm-project/pull/74268


More information about the cfe-commits mailing list