[llvm] r348550 - [DAGCombiner] don't bother saving a SDLoc for a node that's dead; NFCI

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 6 15:53:58 PST 2018


Author: spatel
Date: Thu Dec  6 15:53:58 2018
New Revision: 348550

URL: http://llvm.org/viewvc/llvm-project?rev=348550&view=rev
Log:
[DAGCombiner] don't bother saving a SDLoc for a node that's dead; NFCI

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.

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

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=348550&r1=348549&r2=348550&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Dec  6 15:53:58 2018
@@ -3767,7 +3767,7 @@ SDValue DAGCombiner::hoistLogicOpWithSam
     // 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));
   }




More information about the llvm-commits mailing list