diff options
author | Nadav Rotem <nrotem@apple.com> | 2012-09-13 14:54:28 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2012-09-13 14:54:28 +0000 |
commit | 24a822a5cb707bc2028789dd957e29cec9e08b36 (patch) | |
tree | d29abaad6db3fe5471fb99d1c896f591c8a632a4 /llvm/lib/CodeGen | |
parent | 2bd25fed2966aad94abb81e46de533fdb9fd1441 (diff) | |
download | bcm5719-llvm-24a822a5cb707bc2028789dd957e29cec9e08b36.tar.gz bcm5719-llvm-24a822a5cb707bc2028789dd957e29cec9e08b36.zip |
Fix a dagcombine optimization. The optimization attempts to optimize a bitcast of fneg to integers
by xoring the high-bit. This fails if the source operand is a vector because we need to negate
each of the elements in the vector.
Fix rdar://12281066 PR13813.
llvm-svn: 163802
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index cd0259b4df9..186d09af6ce 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -5441,7 +5441,8 @@ SDValue DAGCombiner::visitBITCAST(SDNode *N) { // This often reduces constant pool loads. if (((N0.getOpcode() == ISD::FNEG && !TLI.isFNegFree(VT)) || (N0.getOpcode() == ISD::FABS && !TLI.isFAbsFree(VT))) && - N0.getNode()->hasOneUse() && VT.isInteger() && !VT.isVector()) { + N0.getNode()->hasOneUse() && VT.isInteger() && + !VT.isVector() && !N0.getValueType().isVector()) { SDValue NewConv = DAG.getNode(ISD::BITCAST, N0.getDebugLoc(), VT, N0.getOperand(0)); AddToWorkList(NewConv.getNode()); |