[llvm] r190318 - [mips] When double precision loads and stores are split into two i32 loads and
Akira Hatanaka
ahatanaka at mips.com
Mon Sep 9 10:59:33 PDT 2013
Author: ahatanak
Date: Mon Sep 9 12:59:32 2013
New Revision: 190318
URL: http://llvm.org/viewvc/llvm-project?rev=190318&view=rev
Log:
[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.
Modified:
llvm/trunk/lib/Target/Mips/MipsSEISelLowering.cpp
Modified: llvm/trunk/lib/Target/Mips/MipsSEISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsSEISelLowering.cpp?rev=190318&r1=190317&r2=190318&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsSEISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsSEISelLowering.cpp Mon Sep 9 12:59:32 2013
@@ -645,7 +645,7 @@ SDValue MipsSETargetLowering::lowerLOAD(
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
// 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,
More information about the llvm-commits
mailing list