1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00
Commit Graph

125 Commits

Author SHA1 Message Date
Dan Gohman
d4a670284c Make several variable declarations static.
llvm-svn: 50696
2008-05-06 01:53:16 +00:00
Dan Gohman
aad233ea10 Use empty() instead of comparing size() with zero.
llvm-svn: 46514
2008-01-29 13:02:09 +00:00
Chris Lattner
ad9a6ccb83 Remove attribution from file headers, per discussion on llvmdev.
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Duncan Sands
14f11d6836 Integrate the readonly/readnone logic more deeply
into alias analysis.  This meant updating the API
which now has versions of the getModRefBehavior,
doesNotAccessMemory and onlyReadsMemory methods
which take a callsite parameter.  These should be
used unless the callsite is not known, since in
general they can do a better job than the versions
that take a function.  Also, users should no longer
call the version of getModRefBehavior that takes
both a function and a callsite.  To reduce the
chance of misuse it is now protected.

llvm-svn: 44487
2007-12-01 07:51:45 +00:00
Anton Korobeynikov
14246a2eba Remove another leak. Due to some reason AliasSetTracker didn't had any dtor...
llvm-svn: 44320
2007-11-25 23:52:02 +00:00
Duncan Sands
eb464e976f Executive summary: getTypeSize -> getTypeStoreSize / getABITypeSize.
The meaning of getTypeSize was not clear - clarifying it is important
now that we have x86 long double and arbitrary precision integers.
The issue with long double is that it requires 80 bits, and this is
not a multiple of its alignment.  This gives a primitive type for
which getTypeSize differed from getABITypeSize.  For arbitrary precision
integers it is even worse: there is the minimum number of bits needed to
hold the type (eg: 36 for an i36), the maximum number of bits that will
be overwriten when storing the type (40 bits for i36) and the ABI size
(i.e. the storage size rounded up to a multiple of the alignment; 64 bits
for i36).

This patch removes getTypeSize (not really - it is still there but
deprecated to allow for a gradual transition).  Instead there is:

(1) getTypeSizeInBits - a number of bits that suffices to hold all
values of the type.  For a primitive type, this is the minimum number
of bits.  For an i36 this is 36 bits.  For x86 long double it is 80.
This corresponds to gcc's TYPE_PRECISION.

(2) getTypeStoreSizeInBits - the maximum number of bits that is
written when storing the type (or read when reading it).  For an
i36 this is 40 bits, for an x86 long double it is 80 bits.  This
is the size alias analysis is interested in (getTypeStoreSize
returns the number of bytes).  There doesn't seem to be anything
corresponding to this in gcc.

(3) getABITypeSizeInBits - this is getTypeStoreSizeInBits rounded
up to a multiple of the alignment.  For an i36 this is 64, for an
x86 long double this is 96 or 128 depending on the OS.  This is the
spacing between consecutive elements when you form an array out of
this type (getABITypeSize returns the number of bytes).  This is
TYPE_SIZE in gcc.

Since successive elements in a SequentialType (arrays, pointers
and vectors) need to be aligned, the spacing between them will be
given by getABITypeSize.  This means that the size of an array
is the length times the getABITypeSize.  It also means that GEP
computations need to use getABITypeSize when computing offsets.
Furthermore, if an alloca allocates several elements at once then
these too need to be aligned, so the size of the alloca has to be
the number of elements multiplied by getABITypeSize.  Logically
speaking this doesn't have to be the case when allocating just
one element, but it is simpler to also use getABITypeSize in this
case.  So alloca's and mallocs should use getABITypeSize.  Finally,
since gcc's only notion of size is that given by getABITypeSize, if
you want to output assembler etc the same as gcc then getABITypeSize
is the size you want.

Since a store will overwrite no more than getTypeStoreSize bytes,
and a read will read no more than that many bytes, this is the
notion of size appropriate for alias analysis calculations.

In this patch I have corrected all type size uses except some of
those in ScalarReplAggregates, lib/Codegen, lib/Target (the hard
cases).  I will get around to auditing these too at some point,
but I could do with some help.

Finally, I made one change which I think wise but others might
consider pointless and suboptimal: in an unpacked struct the
amount of space allocated for a field is now given by the ABI
size rather than getTypeStoreSize.  I did this because every
other place that reserves memory for a type (eg: alloca) now
uses getABITypeSize, and I didn't want to make an exception
for unpacked structs, i.e. I did it to make things more uniform.
This only effects structs containing long doubles and arbitrary
precision integers.  If someone wants to pack these types more
tightly they can always use a packed struct.

llvm-svn: 43620
2007-11-01 20:53:16 +00:00
Dan Gohman
51cadc3b59 Fix a typo in a comment.
llvm-svn: 43553
2007-10-31 14:35:39 +00:00
Dan Gohman
30ba45b569 Use empty() member functions when that's what's being tested for instead
of comparing begin() and end().

llvm-svn: 42585
2007-10-03 19:26:29 +00:00
Devang Patel
42f006a51a Relax unsafe use check. If there is one unconditional use inside the loop then it is safe to promote value even if there is another conditional use inside the loop.
llvm-svn: 42493
2007-10-01 18:12:58 +00:00
Devang Patel
ab58843813 Do not reserve DOM check for GetElementPtrInst.
llvm-svn: 42306
2007-09-25 17:55:50 +00:00
Devang Patel
65f8d0c2d7 Do not promote null values because it may be unsafe to do so.
llvm-svn: 42270
2007-09-24 20:02:42 +00:00
Devang Patel
648d7a1074 Avoid unsafe promotion.
llvm-svn: 42149
2007-09-19 20:18:51 +00:00
Devang Patel
4014965efb Fix PR1657
llvm-svn: 42075
2007-09-18 01:54:42 +00:00
Devang Patel
f06e667e9c Use SmallVector instead of std::vector.
llvm-svn: 41207
2007-08-21 00:31:24 +00:00
Nick Lewycky
9570c4c5ca Typo.
llvm-svn: 41168
2007-08-18 15:08:56 +00:00
Devang Patel
5a3594de20 Add note.
llvm-svn: 40638
2007-07-31 16:52:25 +00:00
Devang Patel
67b3734f28 Implement Simple Analysis interfaces - cloneBasicBlockAnalysis and deleteAnalysisValue.
llvm-svn: 40626
2007-07-31 08:01:41 +00:00
Devang Patel
2e8466c22a LICM preserves scalar evolution and dom frontier.
llvm-svn: 40602
2007-07-30 20:19:59 +00:00
Devang Patel
8d261e921f Do not require ETForest. Now it is unused by LICM.
llvm-svn: 37502
2007-06-07 22:21:15 +00:00
Devang Patel
a466c96f77 Use DominatorTree instead of ETForest.
This allows faster immediate domiantor walk.

llvm-svn: 37500
2007-06-07 21:57:03 +00:00
Dan Gohman
08d77288c1 Allow insertelement, extractelement, and shufflevector to be hoisted/sunk
by LICM.

llvm-svn: 37435
2007-06-05 16:05:55 +00:00
Devang Patel
2ef6caf14f s/llvm::DominatorTreeBase::DomTreeNode/llvm::DomTreeNode/g
llvm-svn: 37407
2007-06-04 00:32:22 +00:00
Devang Patel
d58b82f83a s/DominatorTreeBase::Node/DominatorTreeBase:DomTreeNode/g
llvm-svn: 37403
2007-06-03 06:26:14 +00:00
Devang Patel
bdacf6c9c9 Insert new instructions in AliasSet.
llvm-svn: 37390
2007-06-01 22:15:31 +00:00
Devang Patel
044601033f Fix typo.
llvm-svn: 37360
2007-05-30 15:29:37 +00:00
Nick Lewycky
c2306ff5b4 Fix typo in comment.
llvm-svn: 36873
2007-05-06 13:37:16 +00:00
Devang Patel
cd45427a87 Drop 'const'
llvm-svn: 36662
2007-05-03 01:11:54 +00:00
Devang Patel
8ee9065162 Use 'static const char' instead of 'static const int'.
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.

llvm-svn: 36652
2007-05-02 21:39:20 +00:00
Devang Patel
38a66bc82e Do not use typeinfo to identify pass in pass manager.
llvm-svn: 36632
2007-05-01 21:15:47 +00:00
Devang Patel
e5765bd115 Mem2Reg does not need TargetData.
llvm-svn: 36444
2007-04-25 18:32:35 +00:00
Owen Anderson
df3ece8561 Rollback some changes that adversely affected performance. I'm currently rethinking
my approach to this, so hopefully I'll find a way to do this without making this slower.

llvm-svn: 36392
2007-04-24 06:40:39 +00:00
Owen Anderson
9813f7fa80 Fix a comment.
llvm-svn: 36299
2007-04-21 07:12:44 +00:00
Owen Anderson
41b527b75f Move more passes to using ETForest instead of DominatorTree.
llvm-svn: 36271
2007-04-20 06:27:13 +00:00
Owen Anderson
781cbecd34 Switch more uses of DominatorTree over to ETForest.
llvm-svn: 36254
2007-04-18 05:43:13 +00:00
Dan Gohman
a7e1f3c85b Spell doFinalization right, so that it is a proper virtual override and
gets called.

llvm-svn: 36208
2007-04-17 18:21:36 +00:00
Chris Lattner
022c2bc0c3 fix long lines
llvm-svn: 36031
2007-04-14 23:32:02 +00:00
Dan Gohman
d0a0ea9916 Change uses of Function::front to Function::getEntryBlock for readability.
llvm-svn: 35265
2007-03-22 16:38:57 +00:00
Devang Patel
16107bb71b Now LICM is a LoopPass.
llvm-svn: 35001
2007-03-07 04:41:30 +00:00
Reid Spencer
8749d297f5 Apply the VISIBILITY_HIDDEN field to the remaining anonymous classes in
the Transforms library. This reduces debug library size by 132 KB, debug
binary size by 376 KB, and reduces link time for llvm tools slightly.

llvm-svn: 33939
2007-02-05 23:32:05 +00:00
Reid Spencer
591bfa1e0b Changes to support making the shift instructions be true BinaryOperators.
This feature is needed in order to support shifts of more than 255 bits
on large integer types.  This changes the syntax for llvm assembly to
make shl, ashr and lshr instructions look like a binary operator:
   shl i32 %X, 1
instead of
   shl i32 %X, i8 1
Additionally, this should help a few passes perform additional optimizations.

llvm-svn: 33776
2007-02-02 02:16:23 +00:00
Chris Lattner
7db51ec161 Adjust #includes to match movement of constant folding code from transformutils to libanalysis.
llvm-svn: 33680
2007-01-30 23:46:24 +00:00
Reid Spencer
4428c3483b For PR950:
This patch removes the SetCC instructions and replaces them with the ICmp
and FCmp instructions. The SetCondInst instruction has been removed and
been replaced with ICmpInst and FCmpInst.

llvm-svn: 32751
2006-12-23 06:05:41 +00:00
Chris Lattner
9e7640cf02 Switch over Transforms/Scalar to use the STATISTIC macro. For each statistic
converted, we lose a static initializer.  This also allows GCC to emit warnings
about unused statistics.

llvm-svn: 32690
2006-12-19 21:40:18 +00:00
Chris Lattner
a531ce882e Detemplatize the Statistic class. The only type it is instantiated with
is 'unsigned'.

llvm-svn: 32279
2006-12-06 17:46:33 +00:00
Reid Spencer
992d9788b3 For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.

llvm-svn: 31931
2006-11-27 01:05:10 +00:00
Bill Wendling
1b3a86000a Removed #include <iostream> and replaced with llvm_* streams.
llvm-svn: 31923
2006-11-26 09:46:52 +00:00
Chris Lattner
c35e7175c3 An sinkable instruction may exist with uses, if those uses are in dead blocks.
Handle this.  This fixes PR908 and Transforms/LICM/2006-09-12-DeadUserOfSunkInstr.ll

llvm-svn: 30275
2006-09-12 19:17:09 +00:00
Chris Lattner
a39dcb5377 eliminate RegisterOpt. It does the same thing as RegisterPass.
llvm-svn: 29925
2006-08-27 22:42:52 +00:00
Chris Lattner
b12f94b14a random code cleanups, no functionality change
llvm-svn: 28914
2006-06-26 19:10:05 +00:00
Chris Lattner
2588f0eb8f Make iostream #inclusion explicit
llvm-svn: 25514
2006-01-22 23:32:06 +00:00