[llvm] r320343 - [DAGCombiner] Reuse existing SDLoc variable instead of creating a new one. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 11 00:33:19 PST 2017
Author: ctopper
Date: Mon Dec 11 00:33:19 2017
New Revision: 320343
URL: http://llvm.org/viewvc/llvm-project?rev=320343&view=rev
Log:
[DAGCombiner] Reuse existing SDLoc variable instead of creating a new one. NFC
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=320343&r1=320342&r2=320343&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon Dec 11 00:33:19 2017
@@ -3103,15 +3103,14 @@ SDValue DAGCombiner::visitMULHS(SDNode *
if (isNullConstant(N1))
return N1;
// fold (mulhs x, 1) -> (sra x, size(x)-1)
- if (isOneConstant(N1)) {
- SDLoc DL(N);
+ if (isOneConstant(N1))
return DAG.getNode(ISD::SRA, DL, N0.getValueType(), N0,
DAG.getConstant(N0.getValueSizeInBits() - 1, DL,
getShiftAmountTy(N0.getValueType())));
- }
+
// fold (mulhs x, undef) -> 0
if (N0.isUndef() || N1.isUndef())
- return DAG.getConstant(0, SDLoc(N), VT);
+ return DAG.getConstant(0, DL, VT);
// If the type twice as wide is legal, transform the mulhs to a wider multiply
// plus a shift.
More information about the llvm-commits
mailing list