summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Stop using a clang builtin for Neon vdup_lane intrinsics.Bob Wilson2010-12-072-11/+2
| | | | llvm-svn: 121191
* Stop using a clang builtin for Neon vmull_lane intrinsic.Bob Wilson2010-12-071-21/+4
| | | | llvm-svn: 121189
* Add a missing parameter, without which clang crashes for vqshlu_n intrinsics.Bob Wilson2010-12-071-1/+1
| | | | llvm-svn: 121188
* PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() andJay Foad2010-12-072-20/+15
| | | | | | | | zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method trunc(), to be const and to return a new value instead of modifying the object in place. llvm-svn: 121121
* Type traits intrinsic implementation: __is_base_of(T, U)Francois Pichet2010-12-072-0/+5
| | | | | | New AST node introduced: BinaryTypeTraitExpr; to be reused for more intrinsics. llvm-svn: 121074
* Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall2010-12-069-21/+20
| | | | | | reason this is limited to C++, and it's certainly not limited to temporaries. llvm-svn: 120996
* __block variables require us to evaluate the RHS of an assignment beforeJohn McCall2010-12-063-4/+6
| | | | | | | | | | the LHS, or else the pointer might be invalid. This is kindof dumb, but go ahead and make sure we're doing that for l-value scalar assignment, which fixes a miscompile of obj-c++.dg/block-seq.mm. Leave a FIXME for how to solve this problem for agg __blocks. llvm-svn: 120992
* Fix a bug in the emission of __real/__imag l-values on scalar operands.John McCall2010-12-057-38/+71
| | | | | | | | | Fix a bug in the emission of complex compound assignment l-values. Introduce a method to emit an expression whose value isn't relevant. Make that method evaluate its operand as an l-value if it is one. Fixes our volatile compliance in C++. llvm-svn: 120931
* Add a LayoutBase member function. No functionality change.Anders Carlsson2010-12-041-15/+22
| | | | llvm-svn: 120924
* Replace calls to AppendBytes with calls to AppendPadding when the bytes ↵Anders Carlsson2010-12-041-11/+6
| | | | | | appended are padding. llvm-svn: 120922
* Silly special case: never load when dereferencing void*.John McCall2010-12-041-1/+5
| | | | llvm-svn: 120905
* More anonymous struct/union redesign. This one deals with anonymous field ↵Francois Pichet2010-12-044-24/+14
| | | | | | | | | | | | | | | | used in a constructor initializer list: struct X { X() : au_i1(123) {} union { int au_i1; float au_f1; }; }; clang will now deal with au_i1 explicitly as an IndirectFieldDecl. llvm-svn: 120900
* Remove some defensive calls to EmitLoadOfPropertyRefLValue that shouldn'tJohn McCall2010-12-043-80/+27
| | | | | | | be required, and then fix up some missing loads on overloaded-operator paths which that exposed. llvm-svn: 120896
* Although we currently have explicit lvalue-to-rvalue conversions, they'reJohn McCall2010-12-044-10/+55
| | | | | | | | | | | | | | | | | | | not actually frequently used, because ImpCastExprToType only creates a node if the types differ. So explicitly create an ICE in the lvalue-to-rvalue conversion code in DefaultFunctionArrayLvalueConversion() as well as several other new places, and consistently deal with the consequences throughout the compiler. In addition, introduce a new cast kind for loading an ObjCProperty l-value, and make sure we emit those nodes whenever an ObjCProperty l-value appears that's not on the LHS of an assignment operator. This breaks a couple of rewriter tests, which I've x-failed until future development occurs on the rewriter. Ted Kremenek kindly contributed the analyzer workarounds in this patch. llvm-svn: 120890
* Test case for the l-value base only being evaluated once.John McCall2010-12-043-64/+43
| | | | | | | | | | Also, move the l-value emission code into CGObjC.cpp and teach it, for completeness, to store away self for a super send. Also, inline the super cases for property gets and sets and make them use the correct result type for implicit getter/setter calls. llvm-svn: 120887
* Kill the KVC l-value kind and calculate the base expression when emittingJohn McCall2010-12-048-140/+62
| | | | | | the l-value. llvm-svn: 120884
* Implement -cl-mad-enablePeter Collingbourne2010-12-041-0/+1
| | | | llvm-svn: 120881
* Implement -cl-unsafe-math-optimizationsPeter Collingbourne2010-12-041-0/+1
| | | | llvm-svn: 120879
* Implement -cl-finite-math-onlyPeter Collingbourne2010-12-041-0/+2
| | | | llvm-svn: 120878
* Add support for vmul_p8 Neon intrinsic. Radar 8446141.Bob Wilson2010-12-031-0/+4
| | | | llvm-svn: 120812
* Add a separate rightShift flag instead of reusing the existing "poly" variableBob Wilson2010-12-031-2/+3
| | | | | | to distinguish vsri/vsli. llvm-svn: 120806
* Reflow to a style doug prefers, increasing indentation :-)Chris Lattner2010-12-021-24/+24
| | | | llvm-svn: 120746
* fix PR8726 by teaching the aggregate init optimization code to handle Chris Lattner2010-12-021-0/+33
| | | | | | structs with references in them correctly. llvm-svn: 120722
* IR Gen. part of API support for __block cxxFariborz Jahanian2010-12-025-68/+73
| | | | | | | | objects imported into blocks. //rdar://8594790. Will have a test case coming (as well as one sent to llvm test suite). llvm-svn: 120713
* Improve codegen for initializer lists to use memset more aggressivelyChris Lattner2010-12-024-20/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when an initializer is variable (I handled the constant case in a previous patch). This has three pieces: 1. Enhance AggValueSlot to have a 'isZeroed' bit to tell CGExprAgg that the memory being stored into has previously been memset to zero. 2. Teach CGExprAgg to not emit stores of zero to isZeroed memory. 3. Teach CodeGenFunction::EmitAggExpr to scan initializers to determine whether they are profitable to emit a memset + inividual stores vs stores for everything. The heuristic used is that a global has to be more than 16 bytes and has to be 3/4 zero to be candidate for this xform. The two testcases are illustrative of the scenarios this catches. We now codegen test9 into: call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 400, i32 4, i1 false) %.array = getelementptr inbounds [100 x i32]* %Arr, i32 0, i32 0 %tmp = load i32* %X.addr, align 4 store i32 %tmp, i32* %.array and test10 into: call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 392, i32 8, i1 false) %tmp = getelementptr inbounds %struct.b* %S, i32 0, i32 0 %tmp1 = getelementptr inbounds %struct.a* %tmp, i32 0, i32 0 %tmp2 = load i32* %X.addr, align 4 store i32 %tmp2, i32* %tmp1, align 4 %tmp5 = getelementptr inbounds %struct.b* %S, i32 0, i32 3 %tmp10 = getelementptr inbounds %struct.a* %tmp5, i32 0, i32 4 %tmp11 = load i32* %X.addr, align 4 store i32 %tmp11, i32* %tmp10, align 4 Previously we produced 99 stores of zero for test9 and also tons for test10. This xforms should substantially speed up -O0 builds when it kicks in as well as reducing code size and optimizer heartburn on insane cases. This resolves PR279. llvm-svn: 120692
* attempt to fix a buildbot failure, apparently apache fails to build.Chris Lattner2010-12-021-11/+8
| | | | llvm-svn: 120688
* Add support for the common and nocommon attributes.Eric Christopher2010-12-021-1/+3
| | | | | | rdar://8560647 llvm-svn: 120650
* Enhance the init generation logic to emit a memset followed by a few stores whenChris Lattner2010-12-021-6/+41
| | | | | | | | | | | | | | | | | | | | | | | | | a global is larger than 32 bytes and has fewer than 6 non-zero values in the initializer. Previously we'd turn something like this: char test8(int X) { char str[10000] = "abc"; into a 10K global variable which we then memcpy'd from. Now we generate: %str = alloca [10000 x i8], align 16 %tmp = getelementptr inbounds [10000 x i8]* %str, i64 0, i64 0 call void @llvm.memset.p0i8.i64(i8* %tmp, i8 0, i64 10000, i32 16, i1 false) store i8 97, i8* %tmp, align 16 %0 = getelementptr [10000 x i8]* %str, i64 0, i64 1 store i8 98, i8* %0, align 1 %1 = getelementptr [10000 x i8]* %str, i64 0, i64 2 store i8 99, i8* %1, align 2 Which is much smaller in space and also likely faster. This is part of PR279 llvm-svn: 120645
* Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ↵John McCall2010-12-029-113/+70
| | | | | | | | ObjCPropertyRefExpr into the latter. llvm-svn: 120643
* Restore the lvalue-to-rvalue conversion patch with a minimal fix.John McCall2010-12-013-6/+44
| | | | llvm-svn: 120555
* add some infrastructure that will let us codegenChris Lattner2010-12-011-6/+67
| | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=279#c3 better. No functionality change yet. llvm-svn: 120530
* get some i32/i8/i1 constants from Builder, which is much less painful thanChris Lattner2010-12-011-18/+9
| | | | | | using ConstantInt::get. llvm-svn: 120527
* A CGRecordLayout object persists. Since its contained types mayJohn McCall2010-11-301-4/+5
| | | | | | | refer to opaque types, they must be held via PATypeHolders. I'm not sure why this hasn't blown up before. llvm-svn: 120491
* CGRecordLayoutBuilder does not need to be exported from this module.John McCall2010-11-301-3/+1
| | | | llvm-svn: 120489
* Declaring local static in global blockFariborz Jahanian2010-11-301-3/+13
| | | | | | | literal declaration caused crash in CodeGen. This patch fixes it. pr8707 llvm-svn: 120486
* L-value to r-value conversion is not ready for prime-time.John McCall2010-11-303-44/+6
| | | | llvm-svn: 120433
* Introduce an r-value to l-value cast kind. I'm not promising anythingJohn McCall2010-11-303-6/+44
| | | | | | about the reliability of this yet. llvm-svn: 120422
* Harden CGDebugInfo::CreateType() a bit for cases where we couldn't generate ↵Douglas Gregor2010-11-301-1/+9
| | | | | | type info for its component types llvm-svn: 120401
* Merge System into Support.Michael J. Spencer2010-11-291-1/+1
| | | | llvm-svn: 120297
* Don't store the maximum alignment, we can trivially compute it.Anders Carlsson2010-11-281-12/+21
| | | | llvm-svn: 120268
* More work on laying out virtual bases.Anders Carlsson2010-11-281-9/+46
| | | | llvm-svn: 120257
* BuildVirtualCall doesn't need to take a reference to a pointer.Anders Carlsson2010-11-282-2/+2
| | | | llvm-svn: 120252
* Make the destructor be the 'vtable anchor' of the CGCXXABI class.Anders Carlsson2010-11-282-4/+2
| | | | llvm-svn: 120251
* Move CGCXXABI functions to CGCXXABI.cppAnders Carlsson2010-11-282-157/+155
| | | | llvm-svn: 120250
* Add a CGCXXABI.cpp file.Anders Carlsson2010-11-282-0/+19
| | | | llvm-svn: 120249
* Hide a bunch of symbols.Benjamin Kramer2010-11-252-27/+27
| | | | llvm-svn: 120153
* Begin work on actually laying out virtual bases.Anders Carlsson2010-11-251-1/+32
| | | | llvm-svn: 120140
* Rename RecordLayout::getPrimaryBaseWasVirtual to isPrimaryBaseVirtual.Anders Carlsson2010-11-244-10/+10
| | | | llvm-svn: 120133
* Move code off the primary base info iterator. No functionality change.Anders Carlsson2010-11-241-4/+14
| | | | llvm-svn: 120132
* Add CXXRecordDecl::getIndirectPrimaryBases.Anders Carlsson2010-11-241-1/+6
| | | | llvm-svn: 120129
OpenPOWER on IntegriCloud