[llvm] dbb8434 - SelectionDAG: Add missing AddNodeIDCustom case for MDNodeSDNode.

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 23 11:00:51 PDT 2025


Author: Peter Collingbourne
Date: 2025-04-23T11:00:48-07:00
New Revision: dbb8434ff7b9bb414e2222cb8d9cddac599eadc6

URL: https://github.com/llvm/llvm-project/commit/dbb8434ff7b9bb414e2222cb8d9cddac599eadc6
DIFF: https://github.com/llvm/llvm-project/commit/dbb8434ff7b9bb414e2222cb8d9cddac599eadc6.diff

LOG: SelectionDAG: Add missing AddNodeIDCustom case for MDNodeSDNode.

Without this we ended up never deduplicating MDNodeSDNodes.

Reviewers: arsenm

Reviewed By: arsenm

Pull Request: https://github.com/llvm/llvm-project/pull/136805

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index a41efd58ce4e4..0a2687a16a80c 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -967,6 +967,9 @@ static void AddNodeIDCustom(FoldingSetNodeID &ID, const SDNode *N) {
   case ISD::INTRINSIC_W_CHAIN:
     // Handled by MemIntrinsicSDNode check after the switch.
     break;
+  case ISD::MDNODE_SDNODE:
+    ID.AddPointer(cast<MDNodeSDNode>(N)->getMD());
+    break;
   } // end switch (N->getOpcode())
 
   // MemIntrinsic nodes could also have subclass data, address spaces, and flags


        


More information about the llvm-commits mailing list