[llvm] [CodeGen] Tail Duplication: Remove irrelevant phi node workaround (PR #86981)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 21 17:12:27 PDT 2024
https://github.com/AtariDreams updated https://github.com/llvm/llvm-project/pull/86981
>From 47d21b6fe923f8259a45d5a4b5eb6987fcd98805 Mon Sep 17 00:00:00 2001
From: Rose <gfunni234 at gmail.com>
Date: Thu, 28 Mar 2024 13:00:29 -0400
Subject: [PATCH] [CodeGen] Tail Duplication: Remove irrelevant 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 f5dd21cb927012..2d5549a22cdbec 100644
--- a/llvm/lib/CodeGen/TailDuplicator.cpp
+++ b/llvm/lib/CodeGen/TailDuplicator.cpp
@@ -669,27 +669,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