summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-01-22 23:08:19 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-01-22 23:08:19 +0000
commit1efe904cd7f957f3e63b40947cedf1d42d050e47 (patch)
treec7bf1db52d3b02c2ca5050c290e49f42896ba7b2
parent136cf76a27931b8b82ae6f9776bc8d0faa3eccc1 (diff)
downloadbcm5719-llvm-1efe904cd7f957f3e63b40947cedf1d42d050e47.tar.gz
bcm5719-llvm-1efe904cd7f957f3e63b40947cedf1d42d050e47.zip
- getTypeAlignmentShift() should be returning preferred alignment, not ABI
alignment. - getPreferredAlignmentLog(): remove Double special case. llvm-svn: 33445
-rw-r--r--llvm/lib/Target/TargetData.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/Target/TargetData.cpp b/llvm/lib/Target/TargetData.cpp
index f50e6c3bd39..e9580094949 100644
--- a/llvm/lib/Target/TargetData.cpp
+++ b/llvm/lib/Target/TargetData.cpp
@@ -451,7 +451,7 @@ unsigned char TargetData::getTypeAlignmentPref(const Type *Ty) const {
}
unsigned char TargetData::getTypeAlignmentShift(const Type *Ty) const {
- unsigned Align = getTypeAlignmentABI(Ty);
+ unsigned Align = getTypeAlignmentPref(Ty);
assert(!(Align & (Align-1)) && "Alignment is not a power of two!");
return Log2_32(Align);
}
@@ -514,8 +514,6 @@ unsigned TargetData::getPreferredAlignmentLog(const GlobalVariable *GV) const {
if (GV->hasInitializer()) {
// Always round up alignment of global doubles to 8 bytes.
- if (GV->getType()->getElementType() == Type::DoubleTy && Alignment < 3)
- Alignment = 3;
if (Alignment < 4) {
// If the global is not external, see if it is large. If so, give it a
// larger alignment.
OpenPOWER on IntegriCloud