[llvm-commits] [llvm] r79150 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Evan Cheng
evan.cheng at apple.com
Sat Aug 15 16:41:42 PDT 2009
Author: evancheng
Date: Sat Aug 15 18:41:42 2009
New Revision: 79150
URL: http://llvm.org/viewvc/llvm-project?rev=79150&view=rev
Log:
Needs to check whether unaligned load / store of i64 is legal here.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=79150&r1=79149&r2=79150&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Sat Aug 15 18:41:42 2009
@@ -3108,9 +3108,8 @@
EVT VT = TLI.getOptimalMemOpType(Size, Align, isSrcConst, isSrcStr, DAG);
bool AllowUnalign = TLI.allowsUnalignedMemoryAccesses(VT);
if (VT != MVT::iAny) {
- unsigned NewAlign = (unsigned)
- TLI.getTargetData()->getABITypeAlignment(
- VT.getTypeForEVT(*DAG.getContext()));
+ const Type *Ty = VT.getTypeForEVT(*DAG.getContext());
+ unsigned NewAlign = (unsigned) TLI.getTargetData()->getABITypeAlignment(Ty);
// If source is a string constant, this will require an unaligned load.
if (NewAlign > Align && (isSrcConst || AllowUnalign)) {
if (Dst.getOpcode() != ISD::FrameIndex) {
@@ -3135,7 +3134,7 @@
}
if (VT == MVT::iAny) {
- if (AllowUnalign) {
+ if (TLI.allowsUnalignedMemoryAccesses(MVT::i64)) {
VT = MVT::i64;
} else {
switch (Align & 7) {
More information about the llvm-commits
mailing list