[llvm] [Tail Duplication] Remove Phi Node workaround (PR #86981)

via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 10:20:06 PDT 2024


https://github.com/AtariDreams updated https://github.com/llvm/llvm-project/pull/86981

>From 09dfd61e81f5bdca50c45ee1a75f7a10fde96b6a Mon Sep 17 00:00:00 2001
From: Rose <gfunni234 at gmail.com>
Date: Thu, 28 Mar 2024 13:00:29 -0400
Subject: [PATCH] [Tail Duplication] Remove Phi Node workaround

The comment is quite old, and removing it and then running the old test, it passed without asserting.
---
 llvm/lib/CodeGen/TailDuplicator.cpp | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/llvm/lib/CodeGen/TailDuplicator.cpp b/llvm/lib/CodeGen/TailDuplicator.cpp
index 5ed67bd0a121ed..6b0a9ec791714c 100644
--- a/llvm/lib/CodeGen/TailDuplicator.cpp
+++ b/llvm/lib/CodeGen/TailDuplicator.cpp
@@ -649,27 +649,6 @@ bool TailDuplicator::shouldTailDuplicate(bool IsSimple,
       return false;
   }
 
-  // Check if any of the successors of TailBB has a PHI node in which the
-  // value corresponding to TailBB uses a subregister.
-  // If a phi node uses a register paired with a subregister, the actual
-  // "value type" of the phi may differ from the type of the register without
-  // any subregisters. Due to a bug, tail duplication may add a new operand
-  // without a necessary subregister, producing an invalid code. This is
-  // demonstrated by test/CodeGen/Hexagon/tail-dup-subreg-abort.ll.
-  // Disable tail duplication for this case for now, until the problem is
-  // fixed.
-  for (auto *SB : TailBB.successors()) {
-    for (auto &I : *SB) {
-      if (!I.isPHI())
-        break;
-      unsigned Idx = getPHISrcRegOpIdx(&I, &TailBB);
-      assert(Idx != 0);
-      MachineOperand &PU = I.getOperand(Idx);
-      if (PU.getSubReg() != 0)
-        return false;
-    }
-  }
-
   if (HasIndirectbr && PreRegAlloc)
     return true;
 



More information about the llvm-commits mailing list