diff options
author | Craig Topper <craig.topper@intel.com> | 2017-12-11 08:33:19 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2017-12-11 08:33:19 +0000 |
commit | 65ed4d4492321f3f6f0417dc9be4c5e5cc910b1e (patch) | |
tree | f2ce4be7d6f42dbc6d09f25c77b6638e42e20432 /llvm/lib/CodeGen/SelectionDAG | |
parent | 0bea09b737c592a7de2c5287384a1c31f1728762 (diff) | |
download | bcm5719-llvm-65ed4d4492321f3f6f0417dc9be4c5e5cc910b1e.tar.gz bcm5719-llvm-65ed4d4492321f3f6f0417dc9be4c5e5cc910b1e.zip |
[DAGCombiner] Reuse existing SDLoc variable instead of creating a new one. NFC
llvm-svn: 320343
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index a8ae5e8065f..2170670a0b6 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -3103,15 +3103,14 @@ SDValue DAGCombiner::visitMULHS(SDNode *N) { 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. |