@@ -40768,54 +40768,20 @@ static SDValue combineStore(SDNode *N, SelectionDAG &DAG,
40768
40768
if (!ISD::isNormalLoad(Ld))
40769
40769
return SDValue();
40770
40770
40771
- // If this is not the MMX case, i.e. we are just turning i64 load/store
40772
- // into f64 load/store, avoid the transformation if there are multiple
40773
- // uses of the loaded value.
40774
- if (!VT.isVector() && !Ld->hasNUsesOfValue(1, 0))
40771
+ // Avoid the transformation if there are multiple uses of the loaded value.
40772
+ if (!Ld->hasNUsesOfValue(1, 0))
40775
40773
return SDValue();
40776
40774
40777
40775
SDLoc LdDL(Ld);
40778
40776
SDLoc StDL(N);
40779
- // If we are a 64-bit capable x86, lower to a single movq load/store pair.
40780
- // Otherwise, if it's legal to use f64 SSE instructions, use f64 load/store
40781
- // pair instead.
40782
- if (Subtarget.is64Bit() || F64IsLegal) {
40783
- MVT LdVT = Subtarget.is64Bit() ? MVT::i64 : MVT::f64;
40784
- SDValue NewLd = DAG.getLoad(LdVT, LdDL, Ld->getChain(), Ld->getBasePtr(),
40785
- Ld->getMemOperand());
40786
-
40787
- // Make sure new load is placed in same chain order.
40788
- DAG.makeEquivalentMemoryOrdering(Ld, NewLd);
40789
- return DAG.getStore(St->getChain(), StDL, NewLd, St->getBasePtr(),
40790
- St->getMemOperand());
40791
- }
40792
-
40793
- // Otherwise, lower to two pairs of 32-bit loads / stores.
40794
- SDValue LoAddr = Ld->getBasePtr();
40795
- SDValue HiAddr = DAG.getMemBasePlusOffset(LoAddr, 4, LdDL);
40796
-
40797
- SDValue LoLd = DAG.getLoad(MVT::i32, LdDL, Ld->getChain(), LoAddr,
40798
- Ld->getPointerInfo(), Ld->getAlignment(),
40799
- Ld->getMemOperand()->getFlags());
40800
- SDValue HiLd = DAG.getLoad(MVT::i32, LdDL, Ld->getChain(), HiAddr,
40801
- Ld->getPointerInfo().getWithOffset(4),
40802
- MinAlign(Ld->getAlignment(), 4),
40803
- Ld->getMemOperand()->getFlags());
40804
- // Make sure new loads are placed in same chain order.
40805
- DAG.makeEquivalentMemoryOrdering(Ld, LoLd);
40806
- DAG.makeEquivalentMemoryOrdering(Ld, HiLd);
40807
-
40808
- LoAddr = St->getBasePtr();
40809
- HiAddr = DAG.getMemBasePlusOffset(LoAddr, 4, StDL);
40810
-
40811
- SDValue LoSt =
40812
- DAG.getStore(St->getChain(), StDL, LoLd, LoAddr, St->getPointerInfo(),
40813
- St->getAlignment(), St->getMemOperand()->getFlags());
40814
- SDValue HiSt = DAG.getStore(St->getChain(), StDL, HiLd, HiAddr,
40815
- St->getPointerInfo().getWithOffset(4),
40816
- MinAlign(St->getAlignment(), 4),
40817
- St->getMemOperand()->getFlags());
40818
- return DAG.getNode(ISD::TokenFactor, StDL, MVT::Other, LoSt, HiSt);
40777
+ // Lower to a single movq load/store pair.
40778
+ SDValue NewLd = DAG.getLoad(MVT::f64, LdDL, Ld->getChain(),
40779
+ Ld->getBasePtr(), Ld->getMemOperand());
40780
+
40781
+ // Make sure new load is placed in same chain order.
40782
+ DAG.makeEquivalentMemoryOrdering(Ld, NewLd);
40783
+ return DAG.getStore(St->getChain(), StDL, NewLd, St->getBasePtr(),
40784
+ St->getMemOperand());
40819
40785
}
40820
40786
40821
40787
// This is similar to the above case, but here we handle a scalar 64-bit
0 commit comments