OSDN Git Service

[DAGCombiner] don't bother saving a SDLoc for a node that's dead; NFCI
authorSanjay Patel <spatel@rotateright.com>
Thu, 6 Dec 2018 23:53:58 +0000 (23:53 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 6 Dec 2018 23:53:58 +0000 (23:53 +0000)
We shouldn't care about the debug location for a node that
we're creating, but attaching the root of the pattern should
be the best effort. (If this is not true, then we are doing
it wrong all over the SDAG).

This is no-functional-change-intended, and there are no
regression test diffs...and that's what I expected. But
there's a similar line above this diff, where those
assumptions apparently do not hold.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348550 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index ee7b382..70ce0a7 100644 (file)
@@ -3767,7 +3767,7 @@ SDValue DAGCombiner::hoistLogicOpWithSameOpcodeHands(SDNode *N) {
     // If either operand has other uses, this transform is not an improvement.
     if (!N0.hasOneUse() || !N1.hasOneUse())
       return SDValue();
-    SDValue Logic = DAG.getNode(LogicOpcode, SDLoc(N0), XVT, X, Y);
+    SDValue Logic = DAG.getNode(LogicOpcode, DL, XVT, X, Y);
     AddToWorklist(Logic.getNode());
     return DAG.getNode(HandOpcode, DL, VT, Logic, N0.getOperand(1));
   }