Index: llvm/lib/Target/X86/X86ISelLowering.cpp =================================================================== --- llvm/lib/Target/X86/X86ISelLowering.cpp +++ llvm/lib/Target/X86/X86ISelLowering.cpp @@ -21368,13 +21368,6 @@ if (VT == MVT::f128 || !Subtarget.hasX87()) return SDValue(); - SDValue ValueToStore = Src; - if (SrcVT == MVT::i64 && Subtarget.hasSSE2() && !Subtarget.is64Bit()) - // Bitcasting to f64 here allows us to do a single 64-bit store from - // an SSE register, avoiding the store forwarding penalty that would come - // with two 32-bit stores. - ValueToStore = DAG.getBitcast(MVT::f64, ValueToStore); - unsigned Size = SrcVT.getStoreSize(); Align Alignment(Size); MachineFunction &MF = DAG.getMachineFunction(); @@ -21383,7 +21376,7 @@ MachinePointerInfo MPI = MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), SSFI); SDValue StackSlot = DAG.getFrameIndex(SSFI, PtrVT); - Chain = DAG.getStore(Chain, dl, ValueToStore, StackSlot, MPI, Alignment); + Chain = DAG.getStore(Chain, dl, Src, StackSlot, MPI, Alignment); std::pair Tmp = BuildFILD(VT, SrcVT, dl, Chain, StackSlot, MPI, Alignment, DAG); @@ -21880,15 +21873,8 @@ } assert(SrcVT == MVT::i64 && "Unexpected type in UINT_TO_FP"); - SDValue ValueToStore = Src; - if (isScalarFPTypeInSSEReg(Op.getValueType()) && !Subtarget.is64Bit()) { - // Bitcasting to f64 here allows us to do a single 64-bit store from - // an SSE register, avoiding the store forwarding penalty that would come - // with two 32-bit stores. - ValueToStore = DAG.getBitcast(MVT::f64, ValueToStore); - } - SDValue Store = - DAG.getStore(Chain, dl, ValueToStore, StackSlot, MPI, SlotAlign); + + SDValue Store = DAG.getStore(Chain, dl, Src, StackSlot, MPI, SlotAlign); // For i64 source, we need to add the appropriate power of 2 if the input // was negative. We must be careful to do the computation in x87 extended // precision, not in SSE. @@ -21899,7 +21885,6 @@ SlotAlign, MachineMemOperand::MOLoad); Chain = Fild.getValue(1); - // Check whether the sign bit is set. SDValue SignSet = DAG.getSetCC( dl, getSetCCResultType(DAG.getDataLayout(), *DAG.getContext(), MVT::i64),