[llvm] [AMDGPU] Avoid put implicit_def into bundle that break reg's liveness (PR #142563)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 24 06:24:55 PDT 2025


================
@@ -115,6 +115,21 @@ static DebugLoc getDebugLoc(MachineBasicBlock::instr_iterator FirstMI,
   return DebugLoc();
 }
 
+static bool containRegOrSubReg(SmallSetVector<Register, 32> DefRegs,
+                               Register Reg, const TargetRegisterInfo *TRI) {
+  if (DefRegs.contains(Reg))
+    return true;
+  if (Reg.isPhysical()) {
+    for (const MCPhysReg &SubReg : TRI->subregs(Reg)) {
+      // Applying same logic with MachineVerifier that any of the SubReg is
+      // contained, it counts defined
----------------
arsenm wrote:

Don't really need this comment 

https://github.com/llvm/llvm-project/pull/142563


More information about the llvm-commits mailing list