diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2018-04-12 22:14:58 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2018-04-12 22:14:58 +0000 |
| commit | a54e7d1a6d9bae85abccbe56080f3061603501d3 (patch) | |
| tree | a646866e325a21b9e883d2a44aedf7296d185371 /llvm/lib/CodeGen | |
| parent | 9adb386a8e6bdb5fe725b560b0db5abc45d31034 (diff) | |
| download | bcm5719-llvm-a54e7d1a6d9bae85abccbe56080f3061603501d3.tar.gz bcm5719-llvm-a54e7d1a6d9bae85abccbe56080f3061603501d3.zip | |
[DAGCombiner] simplify code; NFC
llvm-svn: 329964
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 42c754a5331..d0d4768864d 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -673,6 +673,7 @@ static char isNegatibleForFree(SDValue Op, bool LegalOperations, // Don't recurse exponentially. if (Depth > 6) return 0; + EVT VT = Op.getValueType(); switch (Op.getOpcode()) { default: return false; case ISD::ConstantFP: { @@ -681,7 +682,6 @@ static char isNegatibleForFree(SDValue Op, bool LegalOperations, // Don't invert constant FP values after legalization unless the target says // the negated constant is legal. - EVT VT = Op.getValueType(); return TLI.isOperationLegal(ISD::ConstantFP, VT) || TLI.isFPImmLegal(neg(cast<ConstantFPSDNode>(Op)->getValueAPF()), VT); } @@ -690,8 +690,7 @@ static char isNegatibleForFree(SDValue Op, bool LegalOperations, if (!Options->UnsafeFPMath) return 0; // After operation legalization, it might not be legal to create new FSUBs. - if (LegalOperations && - !TLI.isOperationLegalOrCustom(ISD::FSUB, Op.getValueType())) + if (LegalOperations && !TLI.isOperationLegalOrCustom(ISD::FSUB, VT)) return 0; // fold (fneg (fadd A, B)) -> (fsub (fneg A), B) |

