1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

195 Commits

Author SHA1 Message Date
Cameron Zwarich
ae6963bced Fix a regression caused by r102515 where explicit alignment on globals is
ignored. There was a test to catch this, but it was just blindly updated in
a large change. This fixes another part of <rdar://problem/9275290>.

llvm-svn: 129466
2011-04-13 20:36:04 +00:00
Cameron Zwarich
37f1db39c4 Fix an obvious problem with an alignment computation. AsmPrinter actually does
the max itself, so it is not easy to write a test case for this, but I added a
test case that would fail if the code in AsmPrinter were removed.

llvm-svn: 129432
2011-04-13 09:02:43 +00:00
Cameron Zwarich
3f06fb96e5 If a global variable has a specified alignment that is less than the preferred
alignment for its type, use the minimum of the specified alignment and the ABI
alignment. This fixes <rdar://problem/9275290>.

llvm-svn: 129428
2011-04-13 06:03:16 +00:00
Michael J. Spencer
d5ec932c3a Merge System into Support.
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Owen Anderson
46990c17f7 Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which
must be called in the pass's constructor.  This function uses static dependency declarations to recursively initialize
the pass's dependencies.

Clients that only create passes through the createFooPass() APIs will require no changes.  Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.

I have tested this with all standard configurations of clang and llvm-gcc on Darwin.  It is possible that there are problems
with the static dependencies that will only be visible with non-standard options.  If you encounter any crash in pass
registration/creation, please send the testcase to me directly.

llvm-svn: 116820
2010-10-19 17:21:58 +00:00
Michael J. Spencer
cd6be63d05 Fix Whitespace.
llvm-svn: 116800
2010-10-19 07:32:42 +00:00
Owen Anderson
69cbf2e8b7 Now with fewer extraneous semicolons!
llvm-svn: 115996
2010-10-07 22:25:06 +00:00
Dale Johannesen
c7739ca945 Add x86MMX a few more places.
llvm-svn: 113914
2010-09-15 00:52:23 +00:00
Dale Johannesen
b3df2ff13d Add X86 MMX type to bitcode and Type.
(The Ada bindings probably need it too, but all the
obvious places to change say "do not edit this file".)

llvm-svn: 113618
2010-09-10 20:55:01 +00:00
Chris Lattner
ecf276b787 remove unions from LLVM IR. They are severely buggy and not
being actively maintained, improved, or extended.

llvm-svn: 112356
2010-08-28 04:09:24 +00:00
Dan Gohman
54027cf446 Don't use unsigned char for alignments in TargetData. There aren't
that many of these things, so the memory savings isn't significant,
and there are now situations where there can be alignments greater
than 128.

llvm-svn: 110836
2010-08-11 18:15:01 +00:00
Owen Anderson
f2fea95f2f Reapply r110396, with fixes to appease the Linux buildbot gods.
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Owen Anderson
aadd8a89ca Revert r110396 to fix buildbots.
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Owen Anderson
b9762c07cb Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier.  Clean up APIs related to this change.

llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Dan Gohman
041bd99662 Do GEP offset calculations with unsigned math rather than signed math
to avoid undefined behavior on overflow, noticed by John Regehr.

llvm-svn: 109594
2010-07-28 17:11:36 +00:00
Owen Anderson
f8addbb0a1 Fix batch of converting RegisterPass<> to INTIALIZE_PASS().
llvm-svn: 109045
2010-07-21 22:09:45 +00:00
Dan Gohman
6a48222bd8 Change TargetData's algorithm for computing defualt vector type
alignment to match what's used in clang and GCC for __alignof, rather
than trying to guess what Legalize is going to be doing.

llvm-svn: 102206
2010-04-23 19:41:15 +00:00
Chris Lattner
99d17acb35 fix PR6332, allowing an index of zero into a zero sized array
even if the element of the array has no size.

llvm-svn: 101662
2010-04-17 19:02:33 +00:00
Chris Lattner
80b41881bc rename llvm::llvm_report_error -> llvm::report_fatal_error
llvm-svn: 100709
2010-04-07 22:58:41 +00:00
Dan Gohman
7051600e3f Revert the recent alignment changes. They're broken for -Os because,
in particular, they end up aligning strings at 16-byte boundaries, and
there's no way for GlobalOpt to check OptForSize.

llvm-svn: 100172
2010-04-02 03:04:37 +00:00
Dan Gohman
d12e6c92c5 Change variables which are exactly 16 bytes to be 16-byte-aligned too.
This fixes test/Transforms/GlobalOpt/gv-align.ll.

llvm-svn: 100161
2010-04-02 00:46:07 +00:00
Chris Lattner
cf7f134913 reapply r98656 unmodified, which exposed the asmprinter not
handling constant unions.

llvm-svn: 98680
2010-03-16 21:25:55 +00:00
Daniel Dunbar
faade5305c Revert r98656, its breaking all over the place.
llvm-svn: 98662
2010-03-16 19:35:34 +00:00
Chris Lattner
7a96045d0a improve support for uniontype and ConstantUnion, patch by Tim Northover!
llvm-svn: 98656
2010-03-16 19:15:03 +00:00
Dan Gohman
084112437d Revert r97064. Duncan pointed out that bitcasts are defined in
terms of store and load, which means bitcasting between scalar
integer and vector has endian-specific results, which undermines
this whole approach.

llvm-svn: 97137
2010-02-25 15:20:39 +00:00
Dan Gohman
424e8f22d0 Make getTypeSizeInBits work correctly for array types; it should return
the number of value bits, not the number of bits of allocation for in-memory
storage.

Make getTypeStoreSize and getTypeAllocSize work consistently for arrays and
vectors.

Fix several places in CodeGen which compute offsets into in-memory vectors
to use TargetData information.

This fixes PR1784.

llvm-svn: 97064
2010-02-24 22:05:23 +00:00
Duncan Sands
1b33dd3c83 There are two ways of checking for a given type, for example isa<PointerType>(T)
and T->isPointerTy().  Convert most instances of the first form to the second form.
Requested by Chris.

llvm-svn: 96344
2010-02-16 11:11:14 +00:00
Chris Lattner
00ba9a5343 add a method to get the alignment of an integer type even
when we don't have one laying around.  Useful if you don't
have an llvmcontext handy.

llvm-svn: 94468
2010-01-25 23:18:11 +00:00
Chris Lattner
b944c6eca5 finish cleaning up StructLayoutMap.
llvm-svn: 91612
2009-12-17 20:00:21 +00:00
Bill Wendling
60e15336be Calling InvalidateEntry during the refinement was breaking the bootstrap.
llvm-svn: 90656
2009-12-05 07:59:04 +00:00
Bill Wendling
a24fa4e67b Final cleanups:
- Privatize a typedef.
- Call the InvalidateEntry when refining a type.

llvm-svn: 90655
2009-12-05 07:46:49 +00:00
Bill Wendling
fb8e8f8bd7 Inline methods which are called only once.
llvm-svn: 90640
2009-12-05 01:46:01 +00:00
Bill Wendling
7871b8a922 Refactor some code. No functionality change.
llvm-svn: 90639
2009-12-05 01:43:33 +00:00
Bill Wendling
168e8cb33b Some code cleanup. No functionality change.
llvm-svn: 90588
2009-12-04 21:03:02 +00:00
Bill Wendling
4dbdfa814e Revert r90371. It was causing build failures.
llvm-svn: 90383
2009-12-03 01:54:07 +00:00
Bill Wendling
b01be4b16d Further improvements: refactoring code that does the same thing into one
function, converting "dyn_cast" to "cast", asserting the correct things, and
other general cleanups.

llvm-svn: 90371
2009-12-03 01:15:46 +00:00
Chris Lattner
09df97d257 remove some dead std::ostream using code.
llvm-svn: 90366
2009-12-03 00:55:04 +00:00
Chris Lattner
9ce833945e improve portability to avoid conflicting with std::next in c++'0x.
Patch by Howard Hinnant!

llvm-svn: 90365
2009-12-03 00:50:42 +00:00
Bill Wendling
db54e8c67c This initial code is meant to convert TargetData to use an AbstractTypesUser so
that it doesn't have dangling pointers when abstract types are resolved. This
modifies it somewhat to address comments: making the "StructLayoutMap" an
anonymous structure, calling "removeAbstractTypeUser" when appropriate, and
adding asserts where helpful.

llvm-svn: 90362
2009-12-03 00:17:12 +00:00
Bill Wendling
03a196010e The llvm-gcc front-end and the pass manager use two separate TargetData objects.
This is probably not confined to *just* these two things.

Anyway, the llvm-gcc front-end may look up the structure layout information for
an abstract type. That information will be stored into a table with the FE's
TD. Instruction combine can come along and also ask for information on that
abstract type, but for a separate TD (the one associated with the pass manager).

After the type is refined, the old structure layout information in the pass
manager's TD file is out of date. If a new type is allocated in the same space
as the old-unrefined type, then the structure type information in the pass
manager's TD file will be wrong, but won't know it.

Fix this by making the TD's structure type information an abstract type user.

llvm-svn: 89176
2009-11-18 01:03:56 +00:00
Chris Lattner
4c9a0e33f0 Make TargetData::getStringRepresentation spit out native integer types,
this gives llvm-gcc generated modules the right data.

llvm-svn: 86435
2009-11-08 02:32:01 +00:00
Chris Lattner
cdefc1c441 add the ability for TargetData to return information about legal integer
datatypes on a given CPU.  This is intended to allow instcombine and other
transformations to avoid converting big sequences of operations to an
inconvenient width, and will help clean up after SRoA.  See also "Adding 
legal integer sizes to TargetData" on Feb 1, 2009 on llvmdev, and PR3451.

Comments welcome.

llvm-svn: 86370
2009-11-07 09:35:34 +00:00
Chris Lattner
f99bf8cb76 more cleanup.
llvm-svn: 86369
2009-11-07 09:23:04 +00:00
Chris Lattner
d3f71f2a61 rewrite TargetData to use StringRef/raw_ostream instead of thrashing std::strings.
llvm-svn: 86366
2009-11-07 09:13:23 +00:00
Owen Anderson
e1a4b0a055 Try again at privatizing the layout info map, with a rewritten patch.
This preserves the existing behavior much more closely than my previous attempt.

llvm-svn: 79663
2009-08-21 19:59:12 +00:00
Owen Anderson
91de21580f Re-revert r79555. Apparently it's not just buildbot weirdness.
llvm-svn: 79578
2009-08-20 23:51:44 +00:00
Owen Anderson
277bc36265 Reapply r79555 for testing. Daniel's trying to work out some buildbot weirdnesss.
llvm-svn: 79572
2009-08-20 23:14:20 +00:00
Bill Wendling
c810ad4dc6 --- Reverse-merging r79555 into '.':
U    include/llvm/Target/TargetData.h
U    lib/Target/TargetData.cpp

Temporarily revert 79555. It was causing hangs and test failures.

llvm-svn: 79568
2009-08-20 22:04:42 +00:00
Owen Anderson
8eba306123 Make the StructType->StructLayout table private to TargetData, allowing us to avoid locking on it.
llvm-svn: 79555
2009-08-20 18:26:03 +00:00
Dan Gohman
565d0c0f3b Update and fix some comments.
llvm-svn: 79532
2009-08-20 16:27:10 +00:00