[llvm] [Hexagon] Clean up the test from hexinsert pass fix (PR #164858)

Alexey Karyakin via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 23 10:51:08 PDT 2025


https://github.com/quic-akaryaki created https://github.com/llvm/llvm-project/pull/164858

This is a follow-up to #164021. Use `-verify-machineinstrs` to explicitly enable MIR verification after the hexinsert pass. Remove the checks that depended on debug output so the test can run without asserts.

>From 4640f0a28fec7a1b96c8e7283f915e07ddb5aab3 Mon Sep 17 00:00:00 2001
From: Alexey Karyakin <akaryaki at quicinc.com>
Date: Thu, 23 Oct 2025 10:47:52 -0700
Subject: [PATCH] [Hexagon] Clean up the test from hexinsert pass fix

This is a follow-up to #164021. Use `-verify-machineinstrs` to
explicitly enable MIR verification after the hexinsert pass. Remove the
checks that depended on debug output so the test can run without
asserts.
---
 llvm/test/CodeGen/Hexagon/insert-big.ll | 29 ++++++++++++-------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/llvm/test/CodeGen/Hexagon/insert-big.ll b/llvm/test/CodeGen/Hexagon/insert-big.ll
index 8735a6679bf54..dc3ad14a2dddd 100644
--- a/llvm/test/CodeGen/Hexagon/insert-big.ll
+++ b/llvm/test/CodeGen/Hexagon/insert-big.ll
@@ -1,20 +1,19 @@
-; Check that llc does not abort, which happened due to incorrect MIR.
-; RUN: llc -O2 -mtriple=hexagon -insert-max-ifmap=1 < %s
-; RUN: llc -O2 -mtriple=hexagon -insert-max-ifmap=2 < %s
-; RUN: llc -O2 -mtriple=hexagon -insert-max-ifmap=3 < %s
-; RUN: llc -O2 -mtriple=hexagon -insert-max-ifmap=4 < %s
-; RUN: llc -O2 -mtriple=hexagon -insert-max-ifmap=5 < %s
+;; Verify the output of the hexinsert pass, llc will abort if verification
+;; fails. In the failing case, a def (%15) is used in an bb that does
+;; not follow the one with the def, e.g.:
 
-; Look for this symptom, in case llc does not check invalid IR.
-; CHECK-NOT: insert(%14,%5,#5,#5)
+;; # | bb.3 (%ir-block.3):
+;; # |   %17:intregs = S2_insert %15:intregs(tied-def 0), %5:intregs, 5, 5
+;; # |   J2_jump %bb.2, implicit-def dead $pc
+;; # |
+;; # | bb.4 (%ir-block.6):
+;; # |   %15:intregs = S2_insert %6:intregs(tied-def 0), %3:intregs, 5, 5
 
-; RUN: llc -O2 -mtriple=hexagon -insert-max-ifmap=1 -debug-only=hexinsert -stop-after hexinsert < %s 2>&1 | FileCheck %s
-; RUN: llc -O2 -mtriple=hexagon -insert-max-ifmap=2 -debug-only=hexinsert -stop-after hexinsert < %s 2>&1 | FileCheck %s
-; RUN: llc -O2 -mtriple=hexagon -insert-max-ifmap=3 -debug-only=hexinsert -stop-after hexinsert < %s 2>&1 | FileCheck %s
-; RUN: llc -O2 -mtriple=hexagon -insert-max-ifmap=4 -debug-only=hexinsert -stop-after hexinsert < %s 2>&1 | FileCheck %s
-; RUN: llc -O2 -mtriple=hexagon -insert-max-ifmap=5 -debug-only=hexinsert -stop-after hexinsert < %s 2>&1 | FileCheck %s
-
-; REQUIRES: asserts
+; RUN: llc -O2 -mtriple=hexagon -insert-max-ifmap=1 -stop-after hexinsert -verify-machineinstrs < %s
+; RUN: llc -O2 -mtriple=hexagon -insert-max-ifmap=2 -stop-after hexinsert -verify-machineinstrs < %s
+; RUN: llc -O2 -mtriple=hexagon -insert-max-ifmap=3 -stop-after hexinsert -verify-machineinstrs < %s
+; RUN: llc -O2 -mtriple=hexagon -insert-max-ifmap=4 -stop-after hexinsert -verify-machineinstrs < %s
+; RUN: llc -O2 -mtriple=hexagon -insert-max-ifmap=5 -stop-after hexinsert -verify-machineinstrs < %s
 
 define i32 @f(i32 %0, i32 %1, i32 %2) {
 entry:



More information about the llvm-commits mailing list