https://github.com/arsenm updated 
https://github.com/llvm/llvm-project/pull/165960

>From efe2a94f1d02f62d2d80ad98a2dcf87fe2bd1ecc Mon Sep 17 00:00:00 2001
From: Matt Arsenault <[email protected]>
Date: Fri, 31 Oct 2025 18:31:57 -0700
Subject: [PATCH] Hexagon: Enable terminal rule

---
 llvm/lib/Target/Hexagon/HexagonSubtarget.h      | 2 ++
 llvm/test/CodeGen/Hexagon/late_instr.ll         | 2 +-
 llvm/test/CodeGen/Hexagon/swp-carried-1.ll      | 2 +-
 llvm/test/CodeGen/Hexagon/swp-conv3x3-nested.ll | 2 +-
 llvm/test/CodeGen/Hexagon/swp-epilog-phi11.ll   | 2 +-
 llvm/test/CodeGen/Hexagon/swp-epilog-phi12.ll   | 2 +-
 llvm/test/CodeGen/Hexagon/swp-epilog-phi7.ll    | 2 +-
 llvm/test/CodeGen/Hexagon/swp-kernel-phi1.ll    | 2 +-
 llvm/test/CodeGen/Hexagon/swp-matmul-bitext.ll  | 2 +-
 llvm/test/CodeGen/Hexagon/swp-order-copies.ll   | 2 +-
 llvm/test/CodeGen/Hexagon/swp-order-deps7.ll    | 2 +-
 llvm/test/CodeGen/Hexagon/swp-reuse-phi-6.ll    | 2 +-
 12 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/llvm/lib/Target/Hexagon/HexagonSubtarget.h 
b/llvm/lib/Target/Hexagon/HexagonSubtarget.h
index 995f66d0551b4..b3d5d010d378d 100644
--- a/llvm/lib/Target/Hexagon/HexagonSubtarget.h
+++ b/llvm/lib/Target/Hexagon/HexagonSubtarget.h
@@ -295,6 +295,8 @@ class HexagonSubtarget : public HexagonGenSubtargetInfo {
   bool useBSBScheduling() const { return UseBSBScheduling; }
   bool enableMachineScheduler() const override;
 
+  bool enableTerminalRule() const override { return true; }
+
   // Always use the TargetLowering default scheduler.
   // FIXME: This will use the vliw scheduler which is probably just hurting
   // compiler time and will be removed eventually anyway.
diff --git a/llvm/test/CodeGen/Hexagon/late_instr.ll 
b/llvm/test/CodeGen/Hexagon/late_instr.ll
index 93e5a7dba4b3b..6bd1261ed83d5 100644
--- a/llvm/test/CodeGen/Hexagon/late_instr.ll
+++ b/llvm/test/CodeGen/Hexagon/late_instr.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=hexagon -disable-hsdr < %s | FileCheck %s
+; RUN: llc -mtriple=hexagon -disable-hsdr -terminal-rule=0 < %s | FileCheck %s
 
 ; Check if instruction vandqrt.acc and its predecessor are scheduled in 
consecutive packets.
 ; CHECK: or(q{{[0-3]+}},q{{[0-3]+}})
diff --git a/llvm/test/CodeGen/Hexagon/swp-carried-1.ll 
b/llvm/test/CodeGen/Hexagon/swp-carried-1.ll
index 6993bd672c01a..f2beadfbfa64b 100644
--- a/llvm/test/CodeGen/Hexagon/swp-carried-1.ll
+++ b/llvm/test/CodeGen/Hexagon/swp-carried-1.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=hexagon -rdf-opt=0 -disable-hexagon-misched 
-hexagon-initial-cfg-cleanup=0 -lsr-setupcost-depth-limit=1 
-disable-cgp-delete-phis < %s -pipeliner-experimental-cg=true | FileCheck %s
+; RUN: llc -mtriple=hexagon -rdf-opt=0 -disable-hexagon-misched 
-hexagon-initial-cfg-cleanup=0 -lsr-setupcost-depth-limit=1 
-disable-cgp-delete-phis < %s -pipeliner-experimental-cg=true -terminal-rule=0 
| FileCheck %s
 
 ; Test that we generate the correct code when a loop carried value
 ; is scheduled one stage earlier than it's use. The code in
diff --git a/llvm/test/CodeGen/Hexagon/swp-conv3x3-nested.ll 
b/llvm/test/CodeGen/Hexagon/swp-conv3x3-nested.ll
index 006a8b6bfc94a..69b89a680ff5a 100644
--- a/llvm/test/CodeGen/Hexagon/swp-conv3x3-nested.ll
+++ b/llvm/test/CodeGen/Hexagon/swp-conv3x3-nested.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=hexagon < %s -pipeliner-experimental-cg=true | FileCheck %s
+; RUN: llc -mtriple=hexagon < %s -pipeliner-experimental-cg=true 
-terminal-rule=0 | FileCheck %s
 
 ; This version of the conv3x3 test has both loops. This test checks that the
 ; inner loop has 14 packets.
diff --git a/llvm/test/CodeGen/Hexagon/swp-epilog-phi11.ll 
b/llvm/test/CodeGen/Hexagon/swp-epilog-phi11.ll
index d1b9c51c45a2d..0466b6df46142 100644
--- a/llvm/test/CodeGen/Hexagon/swp-epilog-phi11.ll
+++ b/llvm/test/CodeGen/Hexagon/swp-epilog-phi11.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=hexagon-unknown-elf -mcpu=hexagonv55 
-hexagon-initial-cfg-cleanup=0 < %s | FileCheck %s
+; RUN: llc -mtriple=hexagon-unknown-elf -mcpu=hexagonv55 
-hexagon-initial-cfg-cleanup=0 -terminal-rule=0 < %s | FileCheck %s
 
 ; Test that the pipeliner correctly generates the operands in the
 ; epilog.
diff --git a/llvm/test/CodeGen/Hexagon/swp-epilog-phi12.ll 
b/llvm/test/CodeGen/Hexagon/swp-epilog-phi12.ll
index ba479b696f16c..c6631bd9dc16d 100644
--- a/llvm/test/CodeGen/Hexagon/swp-epilog-phi12.ll
+++ b/llvm/test/CodeGen/Hexagon/swp-epilog-phi12.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=hexagon -hexagon-initial-cfg-cleanup=0 
-pipeliner-experimental-cg=true -disable-cgp-delete-phis < %s | FileCheck %s
+; RUN: llc -mtriple=hexagon -hexagon-initial-cfg-cleanup=0 
-pipeliner-experimental-cg=true -disable-cgp-delete-phis -terminal-rule=0 < %s 
| FileCheck %s
 
 ; Test epilogue generation when reading loop-carried dependency from a previous
 ; stage. The first epilogue should read value from iteration N-1 of the kernel.
diff --git a/llvm/test/CodeGen/Hexagon/swp-epilog-phi7.ll 
b/llvm/test/CodeGen/Hexagon/swp-epilog-phi7.ll
index 96a38939dc50e..d90e7c4cde1ca 100644
--- a/llvm/test/CodeGen/Hexagon/swp-epilog-phi7.ll
+++ b/llvm/test/CodeGen/Hexagon/swp-epilog-phi7.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=hexagon -O2 -enable-pipeliner -disable-block-placement=0 < 
%s | FileCheck %s
+; RUN: llc -mtriple=hexagon -O2 -enable-pipeliner -disable-block-placement=0 
-terminal-rule=0 < %s | FileCheck %s
 
 ; For the Phis generated in the epilog, test that we generate the correct
 ; names for the values coming from the prolog stages. The test belows
diff --git a/llvm/test/CodeGen/Hexagon/swp-kernel-phi1.ll 
b/llvm/test/CodeGen/Hexagon/swp-kernel-phi1.ll
index 6ca8e94200b7d..2a428ff941a71 100644
--- a/llvm/test/CodeGen/Hexagon/swp-kernel-phi1.ll
+++ b/llvm/test/CodeGen/Hexagon/swp-kernel-phi1.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=hexagon -enable-pipeliner-opt-size 
-hexagon-initial-cfg-cleanup=0 < %s -pipeliner-experimental-cg=true | FileCheck 
%s
+; RUN: llc -mtriple=hexagon -enable-pipeliner-opt-size 
-hexagon-initial-cfg-cleanup=0 -terminal-rule=0 < %s 
-pipeliner-experimental-cg=true | FileCheck %s
 
 ; Test that we generate the correct names for the phis in the kernel for the
 ; incoming values. In this case, the loop contains a phi and has another phi
diff --git a/llvm/test/CodeGen/Hexagon/swp-matmul-bitext.ll 
b/llvm/test/CodeGen/Hexagon/swp-matmul-bitext.ll
index 42efe60b96d48..a0aeb80a5fa93 100644
--- a/llvm/test/CodeGen/Hexagon/swp-matmul-bitext.ll
+++ b/llvm/test/CodeGen/Hexagon/swp-matmul-bitext.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=hexagon -mcpu=hexagonv60 -enable-pipeliner < %s | 
FileCheck %s
+; RUN: llc -mtriple=hexagon -mcpu=hexagonv60 -enable-pipeliner 
-terminal-rule=0 < %s | FileCheck %s
 
 ; From coremark. Test that we pipeline the matrix multiplication bitextract
 ; function. The pipelined code should have two packets.
diff --git a/llvm/test/CodeGen/Hexagon/swp-order-copies.ll 
b/llvm/test/CodeGen/Hexagon/swp-order-copies.ll
index 1c9cc4a1cf9d8..bbaa8cd635f3e 100644
--- a/llvm/test/CodeGen/Hexagon/swp-order-copies.ll
+++ b/llvm/test/CodeGen/Hexagon/swp-order-copies.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=hexagon < %s -pipeliner-experimental-cg=true | FileCheck %s
+; RUN: llc -mtriple=hexagon < %s -pipeliner-experimental-cg=true 
-terminal-rule=0 | FileCheck %s
 
 ; Test that the instruction ordering code in the pipeliner fixes up dependences
 ; between post-increment register definitions and uses so that the register
diff --git a/llvm/test/CodeGen/Hexagon/swp-order-deps7.ll 
b/llvm/test/CodeGen/Hexagon/swp-order-deps7.ll
index 5f1780fce39d2..38893de0b0829 100644
--- a/llvm/test/CodeGen/Hexagon/swp-order-deps7.ll
+++ b/llvm/test/CodeGen/Hexagon/swp-order-deps7.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=hexagon < %s -pipeliner-experimental-cg=true | FileCheck %s
+; RUN: llc -mtriple=hexagon < %s -pipeliner-experimental-cg=true 
-terminal-rule=0 | FileCheck %s
 
 ; Test that the pipeliner cause an assert and correctly pipelines the
 ; loop.
diff --git a/llvm/test/CodeGen/Hexagon/swp-reuse-phi-6.ll 
b/llvm/test/CodeGen/Hexagon/swp-reuse-phi-6.ll
index 6c8b0638ae5d1..5189812d522c6 100644
--- a/llvm/test/CodeGen/Hexagon/swp-reuse-phi-6.ll
+++ b/llvm/test/CodeGen/Hexagon/swp-reuse-phi-6.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=hexagon < %s -pipeliner-experimental-cg=true | FileCheck %s
+; RUN: llc -mtriple=hexagon < %s -pipeliner-experimental-cg=true 
-terminal-rule=0 | FileCheck %s
 
 ; Test that the pipeliner generates correct code when attempting to reuse
 ; an existing phi. This test case contains a phi that references another

_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to