Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -7425,6 +7425,7 @@ createOperands(N, Ops); } + N->setFlags(Flags); InsertNode(N); SDValue V(N, 0); NewSDValueDbgMsg(V, "Creating new node: ", this); @@ -7506,13 +7507,14 @@ return SDValue(E, 0); N = newSDNode(Opcode, DL.getIROrder(), DL.getDebugLoc(), VTList); - N->setFlags(Flags); createOperands(N, Ops); CSEMap.InsertNode(N, IP); } else { N = newSDNode(Opcode, DL.getIROrder(), DL.getDebugLoc(), VTList); createOperands(N, Ops); } + + N->setFlags(Flags); InsertNode(N); SDValue V(N, 0); NewSDValueDbgMsg(V, "Creating new node: ", this);