https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88398
--- Comment #20 from Wilco <wilco at gcc dot gnu.org> --- I see Kyrill added some examples that show LLVM knows how to unroll loops: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88760 This kind of thing is much worse than a trailing loop, both for branch prediction and codesize: ands x12, x11, 7 beq .L70 cmp x12, 1 beq .L55 cmp x12, 2 beq .L57 cmp x12, 3 beq .L59 cmp x12, 4 beq .L61 cmp x12, 5 beq .L63 cmp x12, 6 bne .L72