Skip to content

Conversation

@quic-akaryaki
Copy link
Contributor

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.

This is a follow-up to llvm#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.
@llvmbot
Copy link
Member

llvmbot commented Oct 23, 2025

@llvm/pr-subscribers-backend-hexagon

Author: Alexey Karyakin (quic-akaryaki)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/164858.diff

1 Files Affected:

  • (modified) llvm/test/CodeGen/Hexagon/insert-big.ll (+14-15)
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:

@quic-akaryaki
Copy link
Contributor Author

Sorry for unnecessary churn. Adding the extra checks besides the MIR verification was a mistake. I manually verified that -verify-machineinstrs catches the error with the fix reverted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants