summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/TargetInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* plumb preferred types down into X86_64ABIInfo::classifyArgumentType,Chris Lattner2010-06-291-4/+14
| | | | | | no functionality change. llvm-svn: 107115
* Pass the LLVM IR version of argument types down into computeInfo.Chris Lattner2010-06-291-8/+24
| | | | | | | | | This is somewhat annoying to do this at this level, but it avoids having ABIInfo know depend on CodeGenTypes for a hint. Nothing is using this yet, so no functionality change. llvm-svn: 107111
* pass/return structs of char and short as i8/i16 to avoidChris Lattner2010-06-281-5/+9
| | | | | | aweful through-memory coersion, just like we do for i32 now. llvm-svn: 107078
* more tidying up.Chris Lattner2010-06-281-32/+45
| | | | llvm-svn: 107076
* random acts of tidying.Chris Lattner2010-06-281-28/+47
| | | | llvm-svn: 107050
* X86-64:Chris Lattner2010-06-281-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pass/return structs of float/int as float/i32 instead of double/i64 to make the code generated for ABI cleaner. Passing in the low part of a double is the same as passing in a float. For example, we now compile: struct DeclGroup { float NumDecls; }; float foo(DeclGroup D); void bar(DeclGroup *D) { foo(*D); } into: %struct.DeclGroup = type { float } define void @_Z3barP9DeclGroup(%struct.DeclGroup* %D) nounwind { entry: %D.addr = alloca %struct.DeclGroup*, align 8 ; <%struct.DeclGroup**> [#uses=2] %agg.tmp = alloca %struct.DeclGroup, align 4 ; <%struct.DeclGroup*> [#uses=2] store %struct.DeclGroup* %D, %struct.DeclGroup** %D.addr %tmp = load %struct.DeclGroup** %D.addr ; <%struct.DeclGroup*> [#uses=1] %tmp1 = bitcast %struct.DeclGroup* %agg.tmp to i8* ; <i8*> [#uses=1] %tmp2 = bitcast %struct.DeclGroup* %tmp to i8* ; <i8*> [#uses=1] call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp1, i8* %tmp2, i64 4, i32 4, i1 false) %coerce.dive = getelementptr %struct.DeclGroup* %agg.tmp, i32 0, i32 0 ; <float*> [#uses=1] %0 = load float* %coerce.dive, align 1 ; <float> [#uses=1] %call = call float @_Z3foo9DeclGroup(float %0) ; <float> [#uses=0] ret void } instead of: %struct.DeclGroup = type { float } define void @_Z3barP9DeclGroup(%struct.DeclGroup* %D) nounwind { entry: %D.addr = alloca %struct.DeclGroup*, align 8 ; <%struct.DeclGroup**> [#uses=2] %agg.tmp = alloca %struct.DeclGroup, align 4 ; <%struct.DeclGroup*> [#uses=2] %tmp3 = alloca double ; <double*> [#uses=2] store %struct.DeclGroup* %D, %struct.DeclGroup** %D.addr %tmp = load %struct.DeclGroup** %D.addr ; <%struct.DeclGroup*> [#uses=1] %tmp1 = bitcast %struct.DeclGroup* %agg.tmp to i8* ; <i8*> [#uses=1] %tmp2 = bitcast %struct.DeclGroup* %tmp to i8* ; <i8*> [#uses=1] call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp1, i8* %tmp2, i64 4, i32 4, i1 false) %coerce.dive = getelementptr %struct.DeclGroup* %agg.tmp, i32 0, i32 0 ; <float*> [#uses=1] %0 = bitcast double* %tmp3 to float* ; <float*> [#uses=1] %1 = load float* %coerce.dive ; <float> [#uses=1] store float %1, float* %0, align 1 %2 = load double* %tmp3 ; <double> [#uses=1] %call = call float @_Z3foo9DeclGroup(double %2) ; <float> [#uses=0] ret void } which is this machine code (at -O0): __Z3barP9DeclGroup: subq $24, %rsp movq %rdi, 16(%rsp) movq 16(%rsp), %rdi leaq 8(%rsp), %rax movl (%rdi), %ecx movl %ecx, (%rax) movss 8(%rsp), %xmm0 callq __Z3foo9DeclGroup addq $24, %rsp ret vs this: __Z3barP9DeclGroup: subq $24, %rsp movq %rdi, 16(%rsp) movq 16(%rsp), %rdi leaq 8(%rsp), %rax movl (%rdi), %ecx movl %ecx, (%rax) movss 8(%rsp), %xmm0 movss %xmm0, (%rsp) movsd (%rsp), %xmm0 callq __Z3foo9DeclGroup addq $24, %rsp ret At -O3, it is the difference between this now: __Z3barP9DeclGroup: movss (%rdi), %xmm0 jmp __Z3foo9DeclGroup # TAILCALL vs this before: __Z3barP9DeclGroup: movl (%rdi), %eax movd %rax, %xmm0 jmp __Z3foo9DeclGroup # TAILCALL llvm-svn: 107048
* finally get around to doing a significant cleanup to irgen:Chris Lattner2010-06-271-18/+13
| | | | | | | | have CGF create and make accessible standard int32,int64 and intptr types. This fixes a ton of 80 column violations introduced by LLVMContextification and cleans up stuff a lot. llvm-svn: 106977
* use more efficient type comparison predicates.Chris Lattner2010-06-261-2/+2
| | | | llvm-svn: 106958
* Change the test for which ABI/CC to use on ARM to be base on the environmentRafael Espindola2010-06-161-3/+4
| | | | | | (the last argument of the triple). llvm-svn: 106131
* Don't set the calling convention for ARM if it is already the default.Rafael Espindola2010-06-161-3/+11
| | | | llvm-svn: 106106
* Give Type::isIntegralType() an ASTContext parameter, so that itDouglas Gregor2010-06-161-1/+1
| | | | | | | | | | | | provides C "integer type" semantics in C and C++ "integral type" semantics in C++. Note that I still need to update isIntegerType (and possibly other predicates) using the same approach I've taken for isIntegralType(). The two should have the same meaning, but currently don't (!). llvm-svn: 106074
* Introduce Type::isIntegralOrEnumerationType(), to cover those placesDouglas Gregor2010-06-161-1/+1
| | | | | | | | | | in C++ that involve both integral and enumeration types. Convert all of the callers to Type::isIntegralType() that are meant to work with both integral and enumeration types over to Type::isIntegralOrEnumerationType(), to prepare to eliminate enumeration types as integral types. llvm-svn: 106071
* Fix passing and returning of objects with non trivial copy constructors onRafael Espindola2010-06-081-0/+10
| | | | | | | | ARM. Fixes PR7310. llvm-svn: 105592
* Implement __builtin_init_dwarf_reg_size_table and __builtin_dwarf_sp_columnJohn McCall2010-05-271-39/+78
| | | | | | | for 32-bit MIPS processors. Hat-tip to rdivacky for providing gcc dumps on this. llvm-svn: 104816
* IRgen: Remove dead function.Daniel Dunbar2010-05-171-17/+0
| | | | llvm-svn: 103945
* C++/Darwin/i386 ABI: Fix some problems with empty record handling.Daniel Dunbar2010-05-171-3/+20
| | | | | | | | - Check bases as part of isEmptyRecord(). - C++ record fields are never empty in the Itanium ABI. llvm-svn: 103944
* C++/ABI/x86_64: Member pointers should be classified as INTEGER.Daniel Dunbar2010-05-151-0/+5
| | | | llvm-svn: 103843
* C++/ABI/i386: Member function pointers should be passed by value.Daniel Dunbar2010-05-151-2/+3
| | | | llvm-svn: 103842
* C++/Darwin/x86: Teach IRgen it can pass reference types in registers.Daniel Dunbar2010-05-141-2/+2
| | | | llvm-svn: 103761
* IRgen/i386/C++: Fix isSingleElementStruct computation for C++ record decls.Daniel Dunbar2010-05-111-0/+24
| | | | | | - Fixes PR7098. llvm-svn: 103514
* ABI/x86-32 & x86-64: Alignment on 'byval' must be set when when the alignmentDaniel Dunbar2010-04-211-19/+40
| | | | | | exceeds the minimum ABI alignment. llvm-svn: 102019
* IRgen/x86-32: Factor out getIndirectResult(), to match x86-64 factoring.Daniel Dunbar2010-04-211-9/+20
| | | | llvm-svn: 102015
* fit in 80 colsChris Lattner2010-04-061-2/+3
| | | | llvm-svn: 100534
* fix PR6433, crash on va_arg of typedef.Chris Lattner2010-03-111-8/+9
| | | | llvm-svn: 98264
* Support PPC-32 DWARF EH intrinisics. Thanks to rdivacky for his assistance.John McCall2010-03-111-0/+77
| | | | llvm-svn: 98206
* Implement __builtin_dwarf_sp_column for i386 (Darwin and not), x86-64 (all),John McCall2010-03-061-0/+81
| | | | | | | and ARM. Implement __builtin_init_dwarf_reg_size_table for i386 (both) and x86-64 (all). llvm-svn: 97859
* Canonicalize parameter and return types before computing ABI info. EliminatesJohn McCall2010-02-241-4/+3
| | | | | | | | | | | a common source of oddities and, in theory, removes some redundant ABI computations. Also fixes a miscompile I introduced yesterday by refactoring some code and causing a slightly different code path to be taken that didn't perform *parameter* type canonicalization, just normal type canonicalization; this in turn caused a bit of ABI code to misfire because it was looking for 'double' or 'float' but received 'const float'. llvm-svn: 97030
* implement EmitVAArg. pretty much the same way other targets do.Sanjiv Gupta2010-02-171-1/+21
| | | | llvm-svn: 96446
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-151-3/+3
| | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! llvm-svn: 96224
* Emit the 'alignstack' LLVM function attribute when we encounter a functionCharles Davis2010-02-131-0/+17
| | | | | | | marked 'force_align_arg_pointer'. Almost there; now all I need to do is finish up the backend. llvm-svn: 96100
* Implement promotion for enumeration types.Douglas Gregor2010-02-021-3/+38
| | | | | | | | | | | | | | | | | | | | | | | | | WHAT!?! It turns out that Type::isPromotableIntegerType() was not considering enumeration types to be promotable, so we would never do the promotion despite having properly computed the promotion type when the enum was defined. Various operations on values of enum type just "worked" because we could still compute the integer rank of an enum type; the oddity, however, is that operations such as "add an enum and an unsigned" would often have an enum result type (!). The bug actually showed up as a spurious -Wformat diagnostic (<rdar://problem/7595366>), but in theory it could cause miscompiles. In this commit: - Enum types with a promotion type of "int" or "unsigned int" are promotable. - Tweaked the computation of promotable types for enums - For all of the ABIs, treat enum types the same way as their underlying types (*not* their promotion types) for argument passing and return values - Extend the ABI tester with support for enumeration types llvm-svn: 95117
* ARM/APCS: Fix classification of small complex integer types as "integer like".Daniel Dunbar2010-02-011-3/+3
| | | | llvm-svn: 95030
* ARM/APCS: Pass Complex types following llvm-gcc.Daniel Dunbar2010-02-011-0/+8
| | | | llvm-svn: 95029
* ARM/APCS ABI: Fix some problems with bit-fields in structures. After rereadingDaniel Dunbar2010-01-291-18/+18
| | | | | | | the ABI spec, this turns out to simplify the code. We still have some annoying code which mismatches the spec with regard to empty structures. llvm-svn: 94796
* Structs and classes with non-trivial destructors or copy constructors should ↵Anders Carlsson2010-01-271-2/+10
| | | | | | be passed indirectly in the 32-bit ABI. Fixes PR6094. llvm-svn: 94656
* Eliminate some Clang warningsDouglas Gregor2010-01-221-7/+7
| | | | llvm-svn: 94177
* Generalize target weirdness handling having proper layering in mind:Anton Korobeynikov2010-01-101-27/+110
| | | | | | | | | 1. Add helper class for sema checks for target attributes 2. Add helper class for codegen of target attributes As a proof-of-concept - implement msp430's 'interrupt' attribute. llvm-svn: 93118
* Rename file to generalization in next commitsAnton Korobeynikov2010-01-101-0/+1821
llvm-svn: 93117
OpenPOWER on IntegriCloud