[llvm] r357179 - [DAG] Fix Lifetime Node ID hashing.

Nirav Dave via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 08:53:01 PDT 2019


Author: niravd
Date: Thu Mar 28 08:53:01 2019
New Revision: 357179

URL: http://llvm.org/viewvc/llvm-project?rev=357179&view=rev
Log:
[DAG] Fix Lifetime Node ID hashing.

Modified:
    llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=357179&r1=357178&r2=357179&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Thu Mar 28 08:53:01 2019
@@ -1708,13 +1708,14 @@ public:
 /// This SDNode is used for LIFETIME_START/LIFETIME_END values, which indicate
 /// the offet and size that are started/ended in the underlying FrameIndex.
 class LifetimeSDNode : public SDNode {
+  friend class SelectionDAG;
   int64_t Size;
   int64_t Offset; // -1 if offset is unknown.
-public:
+
   LifetimeSDNode(unsigned Opcode, unsigned Order, const DebugLoc &dl,
                  SDVTList VTs, int64_t Size, int64_t Offset)
       : SDNode(Opcode, Order, dl, VTs), Size(Size), Offset(Offset) {}
-
+public:
   int64_t getFrameIndex() const {
     return cast<FrameIndexSDNode>(getOperand(1))->getIndex();
   }

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=357179&r1=357178&r2=357179&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Mar 28 08:53:01 2019
@@ -517,6 +517,13 @@ static void AddNodeIDCustom(FoldingSetNo
   case ISD::TargetFrameIndex:
     ID.AddInteger(cast<FrameIndexSDNode>(N)->getIndex());
     break;
+  case ISD::LIFETIME_START:
+  case ISD::LIFETIME_END:
+    if (cast<LifetimeSDNode>(N)->hasOffset()) {
+      ID.AddInteger(cast<LifetimeSDNode>(N)->getSize());
+      ID.AddInteger(cast<LifetimeSDNode>(N)->getOffset());
+    }
+    break;
   case ISD::JumpTable:
   case ISD::TargetJumpTable:
     ID.AddInteger(cast<JumpTableSDNode>(N)->getIndex());




More information about the llvm-commits mailing list