Loop unrolling pass


Is there an LLC pass that allows loops unrolling? If so, how can I use it?

“LLC pass” as in backend pass on MachineInstructions instead of LLVM IR? I don’t think so as I don’t think loops are modeled in the backends. In the IR you can run opt -loop-unroll

Do you know how I can force unroll with opt -loop-unroll? I’ve tried opt -loop-unroll --unroll-count= 4, but it doesn’t seem to work well.