[llvm-commits] [llvm-gcc-4.2] r46971 - in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386-target.h llvm-types.cpp
Dale Johannesen
dalej at apple.com
Mon Feb 11 13:53:29 PST 2008
Author: johannes
Date: Mon Feb 11 15:53:29 2008
New Revision: 46971
URL: http://llvm.org/viewvc/llvm-project?rev=46971&view=rev
Log:
Revert 46958 for the moment; it broke things, and
there's a better way to solve the problem.
Modified:
llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h
llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h?rev=46971&r1=46970&r2=46971&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h Mon Feb 11 15:53:29 2008
@@ -83,15 +83,6 @@
} \
}
-/* Aggregates containing SSE vectors are aligned at 16 bytes as parameters;
- while long double has GCC alignment of 16 bytes (correct for struct layout)
- but is only 4 byte aligned as a parameter. So if a union type contains an
- SSE vector, use that as the basis for the constructed LLVM struct. */
-#define TARGET_LLVM_COMPARE_UNION_FIELDS(curType, newType, curAlign, newAlign) \
- (newAlign==curAlign && TARGET_SSE && \
- TheTarget->getTargetLowering()->getByValTypeAlignment(newType) > \
- TheTarget->getTargetLowering()->getByValTypeAlignment(curType))
-
#ifdef LLVM_ABI_H
extern bool llvm_x86_should_pass_aggregate_in_memory(tree, const Type *);
Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=46971&r1=46970&r2=46971&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Mon Feb 11 15:53:29 2008
@@ -33,7 +33,6 @@
#include "llvm/TypeSymbolTable.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetLowering.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/StringExtras.h"
@@ -1138,7 +1137,7 @@
// 'sret' functions cannot be 'readnone' or 'readonly'.
if (ABIConverter.isStructReturn())
RAttributes &= ~(ParamAttr::ReadNone|ParamAttr::ReadOnly);
-
+
// Compute whether the result needs to be zext or sext'd.
RAttributes |= HandleArgumentExtension(TREE_TYPE(type));
@@ -2125,8 +2124,6 @@
/// ConvertUNION - We know that 'type' is a UNION_TYPE or a QUAL_UNION_TYPE:
/// convert it to an LLVM type.
-/// This involves creating a struct with the right size and alignment. In
-/// some cases this is target dependent.
const Type *TypeConverter::ConvertUNION(tree type, tree orig_type) {
if (const Type *Ty = GET_TYPE_LLVM(type)) {
// If we already compiled this type, and if it was not a forward
@@ -2173,25 +2170,17 @@
// Select TheTy as union type if it meets one of the following criteria
// 1) UnionTy is 0
// 2) TheTy alignment is more then UnionTy
- // 3) TheTy size is greater than UnionTy size and TheTy alignment is equal
- // to UnionTy
+ // 3) TheTy size is greater than UnionTy size and TheTy alignment is equal to UnionTy
// 4) TheTy size is greater then UnionTy size and TheTy is packed
- // FIXME there is no check for packed?
bool useTheTy = false;
if (UnionTy == 0)
useTheTy = true;
else if (Align > MaxAlign)
useTheTy = true;
-#ifdef TARGET_LLVM_COMPARE_UNION_FIELDS
- else
- useTheTy = TARGET_LLVM_COMPARE_UNION_FIELDS(UnionTy, TheTy,
- Align, MaxAlign);
-#else
else if (MaxAlign == Align && Size > MaxSize)
useTheTy = true;
- else if (Size > MaxSize) // FIXME really? Seems wrong to lower alignment
+ else if (Size > MaxSize)
useTheTy = true;
-#endif
if (useTheTy) {
UnionTy = TheTy;
More information about the llvm-commits
mailing list