From: Akira Hatanaka Date: Mon, 9 Sep 2013 17:59:32 +0000 (+0000) Subject: [mips] When double precision loads and stores are split into two i32 loads and X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=2dd3afc5e600b4585e4c2cd08f9a35fd1cf0df61;p=oota-llvm.git [mips] When double precision loads and stores are split into two i32 loads and stores, make sure the load or store that accesses the higher half does not have an alignment that is larger than the offset from the original address. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190318 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/Mips/MipsSEISelLowering.cpp b/lib/Target/Mips/MipsSEISelLowering.cpp index f32e146368c..2436e540f14 100644 --- a/lib/Target/Mips/MipsSEISelLowering.cpp +++ b/lib/Target/Mips/MipsSEISelLowering.cpp @@ -645,7 +645,7 @@ SDValue MipsSETargetLowering::lowerLOAD(SDValue Op, SelectionDAG &DAG) const { SDValue Hi = DAG.getLoad(MVT::i32, DL, Lo.getValue(1), Ptr, MachinePointerInfo(), Nd.isVolatile(), Nd.isNonTemporal(), Nd.isInvariant(), - Nd.getAlignment()); + std::min(Nd.getAlignment(), 4U)); if (!Subtarget->isLittle()) std::swap(Lo, Hi); @@ -681,8 +681,8 @@ SDValue MipsSETargetLowering::lowerSTORE(SDValue Op, SelectionDAG &DAG) const { // i32 store to higher address. Ptr = DAG.getNode(ISD::ADD, DL, PtrVT, Ptr, DAG.getConstant(4, PtrVT)); return DAG.getStore(Chain, DL, Hi, Ptr, MachinePointerInfo(), - Nd.isVolatile(), Nd.isNonTemporal(), Nd.getAlignment(), - Nd.getTBAAInfo()); + Nd.isVolatile(), Nd.isNonTemporal(), + std::min(Nd.getAlignment(), 4U), Nd.getTBAAInfo()); } SDValue MipsSETargetLowering::lowerMulDiv(SDValue Op, unsigned NewOpc,