[llvm] [Hexagon] Add MachineUnroller pass (PR #177197)

Jyotsna Verma via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 22 09:07:00 PST 2026


================
@@ -0,0 +1,596 @@
+//===- MachineUnrollerPass.cpp - Machine loop unroller pass ---------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+// This file implements loop unrolling functionality at the machine instruction
+// (MI) level.
+//===----------------------------------------------------------------------===//
+
----------------
jverma-quic wrote:

You may want to add a comment here explaining why this pass is needed.

This pass complements IR-level loop unrolling rather than replacing it.
The machine unroller runs on MachineInstrs, where it has access to target specific information such as instruction latencies, resource usage, etc. Using this information, it can identify loops where unrolling will actually increase resource utilization and skip those where it would not. Combined with the software pipeliner, this can significantly improve the performance of certain loops on VLIW-type architectures.

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


More information about the llvm-commits mailing list