Do not try to detect DAG combine patterns for integer multiply-add/sub if value
authorAkira Hatanaka <ahatanaka@mips.com>
Fri, 11 Nov 2011 04:18:21 +0000 (04:18 +0000)
committerAkira Hatanaka <ahatanaka@mips.com>
Fri, 11 Nov 2011 04:18:21 +0000 (04:18 +0000)
type is not i32. MIPS does not have 64-bit integer multiply-add/sub
instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144373 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/MipsISelLowering.cpp

index d916edd73ae789908683e9c03c0f0382905db09f..2b0e90b894ea4da0b6dc57334dc15e21a95272fa 100644 (file)
@@ -395,7 +395,8 @@ static SDValue PerformADDECombine(SDNode *N, SelectionDAG& DAG,
   if (DCI.isBeforeLegalize())
     return SDValue();
 
-  if (Subtarget->hasMips32() && SelectMadd(N, &DAG))
+  if (Subtarget->hasMips32() && N->getValueType(0) == MVT::i32 &&
+      SelectMadd(N, &DAG))
     return SDValue(N, 0);
 
   return SDValue();
@@ -407,7 +408,8 @@ static SDValue PerformSUBECombine(SDNode *N, SelectionDAG& DAG,
   if (DCI.isBeforeLegalize())
     return SDValue();
 
-  if (Subtarget->hasMips32() && SelectMsub(N, &DAG))
+  if (Subtarget->hasMips32() && N->getValueType(0) == MVT::i32 &&
+      SelectMsub(N, &DAG))
     return SDValue(N, 0);
 
   return SDValue();