aboutsummaryrefslogtreecommitdiff
path: root/CodeGen
AgeCommit message (Collapse)Author
2007-08-21allow support for volatile lvalues even though it's still not right.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41239 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21Implement parsing and code generation of Objective-C string literals.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41238 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21add a new builder ivar.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41237 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21move EmitLoadOfComplex/EmitStoreOfComplex into ComplexExprEmitter.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41236 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21implement comma for complex.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41235 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21and/or/xor are invalid for complex, even integer complex apparently.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41234 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21simplify code slightlyChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41233 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21reimplement support for complex comparisons, add support for integer complex ↵Chris Lattner
compares. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41231 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21reimplement complex mulChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41226 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21update some comments.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41218 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21Split complex arithmetic codegen out from aggregate codegen.Chris Lattner
This means that we get rid of tons of intermediate allocas. For example: void foo(double _Complex a, double _Complex b) { a = b+a+a; } this used to have 4 temporary allocas, now it has zero of them. This also simplifies the individual visitor methods because they now can all operate on real/imag pairs instead of having to load/store all over the place. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41217 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21simplify this a bit to remove indirectionChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41216 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21reimplement addition of complex numbers.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41215 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21Add the ability to visit binary operators without having toChris Lattner
match on binop then explicitly switching again. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41214 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21switch aggregate expr codegen to use a visitor to localize most of the nasty Chris Lattner
details in its own file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41213 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21Implement code generation for constant CFStrings.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41206 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-20Fix array->pointer decay. This unbreaks test/CodeGen/array.cChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41202 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-20Add support for code generation of builtins.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41188 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-20Modified ArraySubscriptExpr to have accessors getLHS and getRHS in additionTed Kremenek
to getBase and getIdx. getBase and getIdx now return a "normalized" view of the expression (e.g., always "A[4]" instead of possibly "4[A]"). getLHS and getRHS return the expressions with syntactic fidelity to the original source code. Also modified client code of ArraySubscriptExpr, including the AST dumper and pretty printer, the return-stack value checker, and the LLVM code generator. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41180 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-17Add preliminary support for converting struct types.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41145 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-11start splitting out aggregate value computation from EmitExpr into EmitAggExpr.Chris Lattner
aggregate value and scalar expression computation are very different, this gets them away from each other. This causes a temporary regression on some complex number examples. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41014 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10New file, just a placeholder for now.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41002 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10fix a codegen bug handling ocuvector element exprs.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40995 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10implement initial codegen for aggregate return functions. This implementsChris Lattner
codegen for: _Complex double bar(int); void test(_Complex double*); void test2(int c) { _Complex double X; X = bar(1); test(&X); } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40993 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10Fix a bug handling function -> pointer decay and avoid emitting a noopChris Lattner
bitcast. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40992 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08now that implicit conversions are explicit, we can eliminate Chris Lattner
EmitUsualArithmeticConversions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40931 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08now that implicit conversions are explicit, we can eliminateChris Lattner
EmitExprWithUsualUnaryConversions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40929 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04Implement codegen for __builtin_choose_expr. For example:Chris Lattner
struct X { int A; }; void foo() { struct X s; int i; i = __builtin_choose_expr(0, s, i); } compiles to: %tmp = load i32* %i ; <i32> [#uses=1] store i32 %tmp, i32* %i wow :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40801 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03implement codegen support for __builtin_types_compatible_pChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40788 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03Rename AddrLabel and OCUVectorComponent -> AddrLabelExpr and ↵Chris Lattner
OCUVectorElementExpr respectively. This is for consistency with other expr nodes end with *Expr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40785 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03implement codegen for multidest ocuvector expressions, like:Chris Lattner
vec2.yx = vec2; // reverse git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40782 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03add codegen support for storing into a single-element ocu lvalue, such as:Chris Lattner
vec2.x = f; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40781 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03refactor handling of ocuvector lvalue->rvalue codegen into its own method.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40780 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03In the common case where we are shuffling a vector, emit anChris Lattner
llvm vector shuffle instead of a bunch of insert/extract operations. For: vec4 = vec4.yyyy; // splat Emit: %tmp1 = shufflevector <4 x float> %tmp, <4 x float> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > instead of: %tmp1 = extractelement <4 x float> %tmp, i32 1 %tmp2 = insertelement <4 x float> undef, float %tmp1, i32 0 %tmp3 = extractelement <4 x float> %tmp, i32 1 %tmp4 = insertelement <4 x float> %tmp2, float %tmp3, i32 1 %tmp5 = extractelement <4 x float> %tmp, i32 1 %tmp6 = insertelement <4 x float> %tmp4, float %tmp5, i32 2 %tmp7 = extractelement <4 x float> %tmp, i32 1 %tmp8 = insertelement <4 x float> %tmp6, float %tmp7, i32 3 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40779 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03Add support for scalar-returning element accesses like V.xChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40777 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03implement lvalue to rvalue conversion for ocuvector components. We can now ↵Chris Lattner
compile stuff like this: typedef __attribute__(( ocu_vector_type(4) )) float float4; float4 test1(float4 V) { return V.wzyx+V; } to: _test1: pshufd $27, %xmm0, %xmm1 addps %xmm0, %xmm1 movaps %xmm1, %xmm0 ret and: _test1: mfspr r2, 256 oris r3, r2, 4096 mtspr 256, r3 li r3, lo16(LCPI1_0) lis r4, ha16(LCPI1_0) lvx v3, r4, r3 vperm v3, v2, v2, v3 vaddfp v2, v3, v2 mtspr 256, r2 blr git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40771 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02add support for codegen of an OCUVectorComponent as an lvalue.Chris Lattner
We can now codegen: vec4.xy; as nothing! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40769 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02silence some warnings.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40761 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01update this to build with LLVM ToTChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40665 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-21Implement code generation for __func__, __FUNCTION__ and __PRETTY_FUNCTION__Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40162 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19silence a warning by treating ocuvectors the same as vectors.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40037 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-18implement codegen support for sizeof/alignofChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40009 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-16Implement break and continue. Patch by Anders Carlsson!Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39927 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-16Add a hack (mirroring llvm-gcc) to pointer difference Chris Lattner
codegen to compile: int test(int *A, int *B) { return A-B; } into: _test: movl 4(%esp), %eax subl 8(%esp), %eax sarl $2, %eax ret instead of: _test: movl 4(%esp), %eax subl 8(%esp), %eax movl %eax, %ecx sarl $31, %ecx shrl $30, %ecx addl %ecx, %eax sarl $2, %eax ret git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39902 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-15Refactor code so that isIntegerConstantExpr has an ASTContext available.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39884 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14add FIXME and un-XFAIL testGabor Greif
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39858 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14A significant refactoring of the type size stuff to also Chris Lattner
compute type alignment. This info is needed for struct layout. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39850 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14Implement trivial integer initializers, like 'int X = 4;' for globalChris Lattner
vars. Approach suggested by Keith. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39849 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14In "int X,Y;", compile both X and Y.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39848 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14add a fixmeChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39847 91177308-0d34-0410-b5e6-96231b3b80d8