[llvm] [SelectionDAG] Remove arbitrary patch size check (PR #85590)

via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 17 17:29:03 PDT 2024


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

>From dc1092689687f1baf8206c5a6ede27ad06d6d2ce Mon Sep 17 00:00:00 2001
From: Rose <gfunni234 at gmail.com>
Date: Sun, 17 Mar 2024 20:24:41 -0400
Subject: [PATCH] [SelectionDAG] Remove arbitrary patch size check

---
 .../lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 21 +++++--------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 2670f48aebcff5..29ca5c65633551 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -4086,11 +4086,6 @@ KnownBits SelectionDAG::computeKnownBits(SDValue Op, const APInt &DemandedElts,
   case ISD::INTRINSIC_WO_CHAIN:
   case ISD::INTRINSIC_W_CHAIN:
   case ISD::INTRINSIC_VOID:
-    // TODO: Probably okay to remove after audit; here to reduce change size
-    // in initial enablement patch for scalable vectors
-    if (Op.getValueType().isScalableVector())
-      break;
-
     // Allow the target to implement this method for its nodes.
     TLI->computeKnownBitsForTargetNode(Op, Known, DemandedElts, *this, Depth);
     break;
@@ -4929,18 +4924,12 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
   }
 
   // Allow the target to implement this method for its nodes.
-  if (Opcode >= ISD::BUILTIN_OP_END ||
-      Opcode == ISD::INTRINSIC_WO_CHAIN ||
-      Opcode == ISD::INTRINSIC_W_CHAIN ||
-      Opcode == ISD::INTRINSIC_VOID) {
-    // TODO: This can probably be removed once target code is audited.  This
-    // is here purely to reduce patch size and review complexity.
-    if (!VT.isScalableVector()) {
-      unsigned NumBits =
+  if (Opcode >= ISD::BUILTIN_OP_END || Opcode == ISD::INTRINSIC_WO_CHAIN ||
+      Opcode == ISD::INTRINSIC_W_CHAIN || Opcode == ISD::INTRINSIC_VOID) {
+    unsigned NumBits =
         TLI->ComputeNumSignBitsForTargetNode(Op, DemandedElts, *this, Depth);
-      if (NumBits > 1)
-        FirstAnswer = std::max(FirstAnswer, NumBits);
-    }
+    if (NumBits > 1)
+      FirstAnswer = std::max(FirstAnswer, NumBits);
   }
 
   // Finally, if we can prove that the top bits of the result are 0's or 1's,



More information about the llvm-commits mailing list