summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-02-08 19:48:20 +0000
committerDale Johannesen <dalej@apple.com>2008-02-08 19:48:20 +0000
commit0c191872ab61d21907d99695382e157f5d4e4b9f (patch)
treee743502227149762a48e71b8b344cc8079efacd8 /lib
parent86383e1f7cc8c31eafc6e3d8a67ce6f23d1bce63 (diff)
downloadllvm-0c191872ab61d21907d99695382e157f5d4e4b9f.tar.gz
llvm-0c191872ab61d21907d99695382e157f5d4e4b9f.tar.bz2
llvm-0c191872ab61d21907d99695382e157f5d4e4b9f.tar.xz
64-bit (MMX) vectors do not need restrictive alignment.
128-bit vectors need it only when SSE is on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46890 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/X86ISelLowering.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp
index de1a648b08..e4454709ae 100644
--- a/lib/Target/X86/X86ISelLowering.cpp
+++ b/lib/Target/X86/X86ISelLowering.cpp
@@ -704,9 +704,6 @@ static void getMaxByValAlign(const Type *Ty, unsigned &MaxAlign) {
if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) {
if (VTy->getBitWidth() == 128)
MaxAlign = 16;
- else if (VTy->getBitWidth() == 64)
- if (MaxAlign < 8)
- MaxAlign = 8;
} else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
unsigned EltAlign = 0;
getMaxByValAlign(ATy->getElementType(), EltAlign);
@@ -727,13 +724,14 @@ static void getMaxByValAlign(const Type *Ty, unsigned &MaxAlign) {
/// getByValTypeAlignment - Return the desired alignment for ByVal aggregate
/// function arguments in the caller parameter area. For X86, aggregates
-/// that contains are placed at 16-byte boundaries while the rest are at
-/// 4-byte boundaries.
+/// that contain SSE vectors are placed at 16-byte boundaries while the rest
+/// are at 4-byte boundaries.
unsigned X86TargetLowering::getByValTypeAlignment(const Type *Ty) const {
if (Subtarget->is64Bit())
return getTargetData()->getABITypeAlignment(Ty);
unsigned Align = 4;
- getMaxByValAlign(Ty, Align);
+ if (Subtarget->hasSSE1())
+ getMaxByValAlign(Ty, Align);
return Align;
}