aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-01-25 06:14:17 +0000
committerChris Lattner <sabre@nondot.org>2008-01-25 06:14:17 +0000
commit470d5dc2410dd693a11a3c572fe1c5f40c800110 (patch)
treee4f305f841643da7d1002fd7c626005d75a88de9 /lib
parentf82998f868ae995b43eab3fd884829852416ac75 (diff)
downloadexternal_llvm-470d5dc2410dd693a11a3c572fe1c5f40c800110.zip
external_llvm-470d5dc2410dd693a11a3c572fe1c5f40c800110.tar.gz
external_llvm-470d5dc2410dd693a11a3c572fe1c5f40c800110.tar.bz2
optimize fxor like for
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46345 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/X86ISelLowering.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp
index cef8e4b..e4d4ceb 100644
--- a/lib/Target/X86/X86ISelLowering.cpp
+++ b/lib/Target/X86/X86ISelLowering.cpp
@@ -5627,10 +5627,12 @@ static SDOperand PerformSELECTCombine(SDNode *N, SelectionDAG &DAG,
return SDOperand();
}
-/// PerformFORCombine - Do target-specific dag combines on X86ISD::FOR nodes.
+/// PerformFORCombine - Do target-specific dag combines on X86ISD::FOR and
+/// X86ISD::FXOR nodes.
static SDOperand PerformFORCombine(SDNode *N, SelectionDAG &DAG) {
- // FOR(0.0, x) -> x
- // FOR(x, 0.0) -> x
+ assert(N->getOpcode() == X86ISD::FOR || N->getOpcode() == X86ISD::FXOR);
+ // F[X]OR(0.0, x) -> x
+ // F[X]OR(x, 0.0) -> x
if (ConstantFPSDNode *C = dyn_cast<ConstantFPSDNode>(N->getOperand(0)))
if (C->getValueAPF().isPosZero())
return N->getOperand(1);
@@ -5661,6 +5663,7 @@ SDOperand X86TargetLowering::PerformDAGCombine(SDNode *N,
default: break;
case ISD::VECTOR_SHUFFLE: return PerformShuffleCombine(N, DAG, Subtarget);
case ISD::SELECT: return PerformSELECTCombine(N, DAG, Subtarget);
+ case X86ISD::FXOR:
case X86ISD::FOR: return PerformFORCombine(N, DAG);
case X86ISD::FAND: return PerformFANDCombine(N, DAG);
}