diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2009-10-20 21:37:45 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2009-10-20 21:37:45 +0000 |
commit | a6faf60831fa912c5a808d5b49f7c4d09bff7734 (patch) | |
tree | 01c9132ca0279215c2c8c03f2238734065fd49e5 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | 16edcd724aafaee46b9ce390ec248fc3df63fb38 (diff) | |
download | bcm5719-llvm-a6faf60831fa912c5a808d5b49f7c4d09bff7734.tar.gz bcm5719-llvm-a6faf60831fa912c5a808d5b49f7c4d09bff7734.zip |
Fix invalid for vector types fneg(bitconvert(x)) => bitconvert(x ^ sign)
transform.
llvm-svn: 84683
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 1ed30821520..e3f8f0ff2e6 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -4381,15 +4381,17 @@ SDValue DAGCombiner::visitFP_EXTEND(SDNode *N) { SDValue DAGCombiner::visitFNEG(SDNode *N) { SDValue N0 = N->getOperand(0); + EVT VT = N->getValueType(0); if (isNegatibleForFree(N0, LegalOperations)) return GetNegatedExpression(N0, DAG, LegalOperations); // Transform fneg(bitconvert(x)) -> bitconvert(x^sign) to avoid loading // constant pool values. - if (N0.getOpcode() == ISD::BIT_CONVERT && N0.getNode()->hasOneUse() && - N0.getOperand(0).getValueType().isInteger() && - !N0.getOperand(0).getValueType().isVector()) { + if (N0.getOpcode() == ISD::BIT_CONVERT && + !VT.isVector() && + N0.getNode()->hasOneUse() && + N0.getOperand(0).getValueType().isInteger()) { SDValue Int = N0.getOperand(0); EVT IntVT = Int.getValueType(); if (IntVT.isInteger() && !IntVT.isVector()) { @@ -4397,7 +4399,7 @@ SDValue DAGCombiner::visitFNEG(SDNode *N) { DAG.getConstant(APInt::getSignBit(IntVT.getSizeInBits()), IntVT)); AddToWorkList(Int.getNode()); return DAG.getNode(ISD::BIT_CONVERT, N->getDebugLoc(), - N->getValueType(0), Int); + VT, Int); } } |