[llvm] RISCV: Stop setting kill flags on virtual registers before FinalizeISel (PR #229013)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 5 02:04:41 PDT 2026


https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/229013

Kill flags have no remaining use before register allocation and are
stripped by LiveIntervals.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>

>From 12888ae89820ceeb3adfc1045ea4211c0cb82704 Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Sun, 4 Oct 2026 23:35:10 +0200
Subject: [PATCH] RISCV: Stop setting kill flags on virtual registers before
 FinalizeISel

Kill flags have no remaining use before register allocation and are
stripped by LiveIntervals.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
---
 llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index 4b9175b9aad27..c3a68be23930a 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -27102,7 +27102,7 @@ static MachineBasicBlock *emitQuietFCMP(MachineInstr &MI, MachineBasicBlock *BB,
 
   // Restore the FFLAGS.
   BuildMI(*BB, MI, DL, TII.get(RISCV::WriteFFLAGS))
-      .addReg(SavedFFlags, RegState::Kill);
+      .addReg(SavedFFlags);
 
   // Issue a dummy FEQ opcode to raise exception for signaling NaNs.
   auto MIB2 = BuildMI(*BB, MI, DL, TII.get(EqOpcode), RISCV::X0)
@@ -27442,7 +27442,7 @@ static MachineBasicBlock *emitVFROUND_NOEXCEPT_MASK(MachineInstr &MI,
 
   // Restore FFLAGS.
   BuildMI(*BB, MI, DL, TII.get(RISCV::WriteFFLAGS))
-      .addReg(SavedFFLAGS, RegState::Kill);
+      .addReg(SavedFFLAGS);
 
   // Erase the pseudoinstruction.
   MI.eraseFromParent();



More information about the llvm-commits mailing list