summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Simplify wide bit-field layout in CGRecordLayoutBuilder, and also fix a bug ↵Anders Carlsson2010-04-171-15/+10
| | | | | | where assigning to a bit-field member would overwrite other parts of the struct. llvm-svn: 101681
* Fix an assert when assigning a boolean value to a bitfield of type _Bool.Anders Carlsson2010-04-171-1/+5
| | | | llvm-svn: 101678
* Unnamed bit-fields in a union should be laid out with a type that doesn't ↵Anders Carlsson2010-04-171-1/+17
| | | | | | affect alignment. llvm-svn: 101673
* Factor union field layout code out into a separate function. No ↵Anders Carlsson2010-04-171-18/+31
| | | | | | functionality change. llvm-svn: 101671
* Vtable -> VTable renames across the board.Anders Carlsson2010-04-1716-102/+102
| | | | llvm-svn: 101666
* fix integrated assembler with i386 objc code.Chris Lattner2010-04-171-4/+4
| | | | llvm-svn: 101660
* Fix a bug where we would sometimes incorrectly mark an vtable function as ↵Anders Carlsson2010-04-171-6/+3
| | | | | | unused. llvm-svn: 101643
* Add raw_ostream operators to NamedDecl for convenience. Switch over all ↵Benjamin Kramer2010-04-172-2/+2
| | | | | | | | users of getNameAsString on a stream. The next step is to print the name directly into the stream, avoiding a temporary std::string copy. llvm-svn: 101632
* revert r101568, which miscompiles this testcase, distilled from ldecod:Chris Lattner2010-04-171-5/+6
| | | | | | | | | | void exit_picture() { char yuv_types[4][6]= {"4:0:0","4:2:0","4:2:2","4:4:4"}; foo(yuv_types); } llvm-svn: 101623
* fix PR6766: codegen of var initialized with wide charNuno Lopes2010-04-161-6/+5
| | | | llvm-svn: 101568
* fix a bogus assertion exposed by a recent change: packing theChris Lattner2010-04-161-1/+1
| | | | | | | | | | | | | | | | | struct may cause it to shrink more than one byte. Before my recent changes we compiled the new test into: %0 = type { [6 x i8] } @x = global %0 { [6 x i8] undef }, align 2 ; <%0*> [#uses=0] which is obviously bogus. Now we compile it into: %0 = type <{ i32, i8, i8 }> @x = global %0 zeroinitializer, align 2 ; <%0*> [#uses=0] Where the last byte only is tail padding. llvm-svn: 101536
* emit padding as undef values, take 2Nuno Lopes2010-04-161-3/+3
| | | | | | merge also a few tests I had here for this feature, and FileCheck'ize one file llvm-svn: 101535
* Make CGRecordLayoutBuilder deal with wide bit-fields. Will land tests ↵Anders Carlsson2010-04-161-1/+20
| | | | | | shortly (Daniel, please review). llvm-svn: 101472
* tidy upChris Lattner2010-04-161-1/+0
| | | | llvm-svn: 101447
* IRgen: Change CGBitFieldInfo to take the AccessInfo as constructor ↵Daniel Dunbar2010-04-153-20/+38
| | | | | | | | arguments, it is now an immutable object. Also, add some checking of various invariants that should hold on the CGBitFieldInfo access. llvm-svn: 101345
* IRgen: Eliminate now unused fields from CGBitFieldInfo.Daniel Dunbar2010-04-153-22/+15
| | | | llvm-svn: 101344
* IRgen: (Reapply 101222, with fixes) Move EmitStoreThroughBitfieldLValue to ↵Daniel Dunbar2010-04-151-88/+84
| | | | | | | | | | | | | | | | use new CGBitfieldInfo::AccessInfo decomposition, instead of computing the access policy itself. - Sadly, this doesn't seem to give any .ll size win so far. It is possible to make this routine significantly smarter & avoid various shifting, masking, and zext/sext, but I'm not really convinced it is worth it. It is tricky, and this is really instcombine's job. - No intended functionality change; the test case is just to increase coverage & serves as a demo file, it worked before this commit. The new fixes from r101222 are: 1. The shift to the target position needs to occur after the value is extended to the correct size. This broke Clang bootstrap, among other things no doubt. 2. Swap the order of arguments to OR, to get a tad more constant folding. llvm-svn: 101339
* Rewrite handling of 64-bit palignr intrinsics to be vector shuffles.Eric Christopher2010-04-151-2/+32
| | | | | | | | | Stop multiplying constant by 8 accordingly in the header and change intrinsic definition for what types we expect. Add to existing palignr test to check that we're emitting the correct things. llvm-svn: 101332
* IRgen/NeXT: Simplify to use AST record layout for getting offsets instead of theDaniel Dunbar2010-04-141-13/+4
| | | | | | IRgen record layout, which this code doesn't need to depend on. llvm-svn: 101257
* Speculatively revert "IRgen: Move EmitStoreThroughBitfieldLValue to use new ↵Daniel Dunbar2010-04-141-82/+88
| | | | | | CGBitfieldInfo::AccessInfo decomposition, instead of computing the access policy itself.", I think it might be breaking bootstrap. llvm-svn: 101235
* IRgen: Move EmitStoreThroughBitfieldLValue to use new ↵Daniel Dunbar2010-04-141-88/+82
| | | | | | | | | | CGBitfieldInfo::AccessInfo decomposition, instead of computing the access policy itself. - Sadly, this doesn't seem to give any .ll size win so far. It is possible to make this routine significantly smarter & avoid various shifting, masking, and zext/sext, but I'm not really convinced it is worth it. It is tricky, and this is really instcombine's job. - No intended functionality change; the test case is just to increase coverage & serves as a demo file, it worked before this commit. llvm-svn: 101222
* IRgen: Tweak CGBitFieldInfo doxyments & add an accessor.Daniel Dunbar2010-04-141-0/+10
| | | | llvm-svn: 101221
* implement altivec.h and a bunch of support code, patch by Anton Yartsev!Chris Lattner2010-04-141-0/+44
| | | | llvm-svn: 101215
* IRgen: Move EmitLoadOfBitfieldLValue to use new CGBitfieldInfo::AccessInfo ↵Daniel Dunbar2010-04-131-51/+61
| | | | | | | | | | | | decomposition, instead of computing the access policy itself. - This lets the method focus slightly more on emitting clean IR to honor the policy which has been selected. On 403.gcc's combine.c, x86_64, -O0, this reduces the number of lines in the .ll file (~= # of instructions) by 2.5%. - No intended functionality change -- at -O3 this should produce equivalent if not identical output. On 403.gcc's combine.c, x86_64, -O3, this isn't quite true and some of the changes are regressions, but I'm not going to worry about that until we move to a new access policy. - There is still some room for improvement in the generated IR, in particular we can usually fold the sign-extension of the bit-field into one of the component access. See the FIXME. llvm-svn: 101192
* IRgen: Enhance CGBitFieldInfo with enough information to fully describe the ↵Daniel Dunbar2010-04-133-6/+159
| | | | | | | | | | "policy" with which a bit-field should be accessed. - For now, these policies are computed to match the current IRgen strategy, although the new information isn't being used yet (except in -fdump-record-layouts). - Design comments appreciated. llvm-svn: 101178
* Removes a FIXME.Fariborz Jahanian2010-04-131-4/+2
| | | | llvm-svn: 101161
* Variation of objc_copyStruct API generation whenFariborz Jahanian2010-04-132-7/+22
| | | | | | | property (atomic/nonatomic) is of aggregate type with gc'able member objects) (NeXT runtime). llvm-svn: 101156
* Rework the ConstStructBuilder code to emit missing initializerChris Lattner2010-04-131-25/+31
| | | | | | | | | | | | | | | | | | | | | | | | elements with explicit zero values instead of with tail padding. On an example like this: struct foo { int a; int b; }; struct foo fooarray[] = { {1, 2}, {4}, }; We now lay this out as: @fooarray = global [2 x %struct.foo] [%struct.foo { i32 1, i32 2 }, %struct.foo { i32 4, i32 0 }] instead of as: @fooarray = global %0 <{ %struct.foo { i32 1, i32 2 }, %1 { i32 4, [4 x i8] zeroinitializer } }> Preserving both the struct type of the second element, but also the array type of the entire thing. llvm-svn: 101155
* unbreak tests.Chris Lattner2010-04-131-6/+6
| | | | llvm-svn: 101153
* move a bunch of ConstStructBuilder methods out of line.Chris Lattner2010-04-131-260/+282
| | | | llvm-svn: 101152
* minor cleanupsChris Lattner2010-04-131-26/+28
| | | | llvm-svn: 101151
* Add support for objc_copyStruct to enforceFariborz Jahanian2010-04-132-1/+80
| | | | | | | atomicity of aggregate properties in setter/getter methods. wip. llvm-svn: 101107
* Fix debug info for cleanup block.Devang Patel2010-04-132-1/+6
| | | | llvm-svn: 101100
* fix PR6660/6168: emit padding as zeros instead of undef. Because Chris Lattner2010-04-121-3/+3
| | | | | | | | trailing fields may not be represented in initializer lists, they are being handled as padding and those fields *must* be zero initialized. llvm-svn: 101067
* IRgen: Factor out ComputeBitFieldInfo.Daniel Dunbar2010-04-121-18/+21
| | | | llvm-svn: 101066
* Add some API code for future work.Fariborz Jahanian2010-04-123-0/+37
| | | | llvm-svn: 101052
* IRgen: Add CGRecordLayout::dump, and dump (irgen) record layouts as part of ↵Daniel Dunbar2010-04-122-1/+47
| | | | | | -fdump-record-layouts. llvm-svn: 101051
* Have the CXXBaseOrMemberInitializer keep track of whether an initializer ↵Anders Carlsson2010-04-121-11/+1
| | | | | | initializes a virtual base or not. llvm-svn: 101004
* Fix another bug where we wouldn't generate secondary vtables for ↵Anders Carlsson2010-04-111-5/+9
| | | | | | construction vtables in some cases. llvm-svn: 100998
* More renames.Anders Carlsson2010-04-111-46/+46
| | | | llvm-svn: 100991
* Rename a function parameter.Anders Carlsson2010-04-111-6/+10
| | | | llvm-svn: 100990
* Clarify an assertion.Anders Carlsson2010-04-111-1/+2
| | | | llvm-svn: 100986
* Fix a bug where we were adding too many vcall offsets in some cases.Anders Carlsson2010-04-111-20/+7
| | | | llvm-svn: 100985
* Enable an assert and remove a now unnecessary assert.Anders Carlsson2010-04-101-12/+0
| | | | llvm-svn: 100953
* Fix a bug where we would add the same function twice in a vtable.Anders Carlsson2010-04-101-18/+20
| | | | llvm-svn: 100949
* revert 100942, pending discussion.Chris Lattner2010-04-101-1/+1
| | | | llvm-svn: 100946
* Rename VtableComponent and VtableBuilder.Anders Carlsson2010-04-101-90/+90
| | | | llvm-svn: 100945
* Fix for PR6811.David Chisnall2010-04-101-1/+1
| | | | llvm-svn: 100942
* fix PR6805: llvm.objectsize changed to take an i1 instead of an i32.Chris Lattner2010-04-101-8/+5
| | | | llvm-svn: 100938
* A bunch of string-related microoptimizations in Mangler.Benjamin Kramer2010-04-101-22/+22
| | | | llvm-svn: 100928
OpenPOWER on IntegriCloud