[llvm] [RISCV] Fix using undefined variable %pt2 in mask-reg-alloc.mir testcase (PR #70764)

Jim Lin via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 30 22:12:09 PDT 2023


https://github.com/tclin914 created https://github.com/llvm/llvm-project/pull/70764

First PseudoVMERGE_VIM_M1 should use %pt1 as its operand instead of %pt2.

I found this error when I add LiveIntervals analysis pass in my downstream. And it crashes with the message:

```
Use of %7 does not have a corresponding definition on every path:
112r %6:vrnov0 = PseudoVMERGE_VIM_M1 %pt2:vrnov0(tied-def 0), %2:vr, 1, %4:vmv0, 1, 3
LLVM ERROR: Use not jointly dominated by defs.
```

>From 45d4c551e1ecbf7b0f8947092884d5d7d7e7d52b Mon Sep 17 00:00:00 2001
From: Jim Lin <jim at andestech.com>
Date: Tue, 31 Oct 2023 10:00:20 +0800
Subject: [PATCH] [RISCV] Fix using undefined variable %pt2 in
 mask-reg-alloc.mir testcase

First PseudoVMERGE_VIM_M1 should use %pt1 as its operand instead of %pt2.

I found this error when I add LiveIntervals analysis pass in my
downstream. And it crashes with the message:

`Use of %7 does not have a corresponding definition on every path:
 112r %6:vrnov0 = PseudoVMERGE_VIM_M1 %pt2:vrnov0(tied-def 0), %2:vr, 1, %4:vmv0, 1, 3
 LLVM ERROR: Use not jointly dominated by defs.`
---
 llvm/test/CodeGen/RISCV/rvv/mask-reg-alloc.mir | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/test/CodeGen/RISCV/rvv/mask-reg-alloc.mir b/llvm/test/CodeGen/RISCV/rvv/mask-reg-alloc.mir
index f6d9feea47b5a5f..0e207731e020b83 100644
--- a/llvm/test/CodeGen/RISCV/rvv/mask-reg-alloc.mir
+++ b/llvm/test/CodeGen/RISCV/rvv/mask-reg-alloc.mir
@@ -28,7 +28,7 @@ body:             |
     %3:vr = COPY $v3
     %4:vmv0 = COPY %0
     %pt1:vrnov0 = IMPLICIT_DEF
-    %5:vrnov0 = PseudoVMERGE_VIM_M1 %pt2, killed %2, 1, %4, 1, 3
+    %5:vrnov0 = PseudoVMERGE_VIM_M1 %pt1, killed %2, 1, %4, 1, 3
     %6:vmv0 = COPY %1
     %pt2:vrnov0 = IMPLICIT_DEF
     %7:vrnov0 = PseudoVMERGE_VIM_M1 %pt2, killed %3, 1, %6, 1, 3



More information about the llvm-commits mailing list