//
// The LLVM Compiler Infrastructure
//
-// This file was developed by Nate Begeman and is distributed under the
-// University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0);
MVT::ValueType VT = N->getValueType(0);
+ // If this is fp_round(fpextend), don't fold it, allow ourselves to be folded.
+ if (N->hasOneUse() && (*N->use_begin())->getOpcode() == ISD::FP_ROUND)
+ return SDOperand();
+
// fold (fp_extend c1fp) -> c1fp
if (N0CFP && VT != MVT::ppcf128)
return DAG.getNode(ISD::FP_EXTEND, VT, N0);
if (LoadSDNode *Ld = dyn_cast<LoadSDNode>(Value)) {
if (Chain.Val == Ld && Ld->getBasePtr() == Ptr &&
ST->getAddressingMode() == ISD::UNINDEXED &&
- ST->getStoredVT() == Ld->getLoadedVT()) {
+ ST->getStoredVT() == Ld->getLoadedVT() &&
+ !ST->isVolatile()) {
// The store is dead, remove it.
return Chain;
}