1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 04:52:54 +02:00
Commit Graph

7314 Commits

Author SHA1 Message Date
Chris Lattner
9f7facc8eb Cache TargetData/AliasAnalysis in the pass instead of calling
getAnalysis<>.  getAnalysis<> is apparently extremely expensive.
Doing this speeds up GVN on 403.gcc by 16%!

llvm-svn: 60304
2008-11-30 19:24:31 +00:00
Chris Lattner
ee7fbed62d add the rest of the comparison routines.
llvm-svn: 60303
2008-11-30 19:10:41 +00:00
Chris Lattner
baf3cdd3a1 Two changes: Make getDependency remove QueryInst for a dirty record's
ReverseLocalDeps when we update it.  This fixes a regression test
failure from my last commit.

Second, for each non-local cached information structure, keep a bit that
indicates whether it is dirty or not.  This saves us a scan over the whole
thing in the common case when it isn't dirty.

llvm-svn: 60274
2008-11-30 02:52:26 +00:00
Chris Lattner
90904fda3c introduce a typedef, no functionality change.
llvm-svn: 60272
2008-11-30 02:30:50 +00:00
Chris Lattner
a772cad6ff Change NonLocalDeps to be a densemap of pointers to densemap
instead of containing them by value.  This increases the density
(!) of NonLocalDeps as well as making the reallocation case 
faster.  This speeds up gvn on 403.gcc by 2% and makes room for
future improvements.

I'm not super thrilled with having to explicitly manage the new/delete
of the map, but it is necesary for the next change.

llvm-svn: 60271
2008-11-30 02:28:25 +00:00
Chris Lattner
ae0e214d84 implement a fixme by introducing a new getDependencyFromInternal
method that returns its result as a DepResultTy instead of as a
MemDepResult.  This reduces conversion back and forth.

llvm-svn: 60266
2008-11-30 01:26:32 +00:00
Chris Lattner
9be5c5c763 REmove an old fixme, resolve another fixme by adding liberal
comments about what this class does.

llvm-svn: 60264
2008-11-30 01:17:08 +00:00
Chris Lattner
8c592b282e fix indentation. std::pair is "isPod" if the first/second are both isPod.
llvm-svn: 60262
2008-11-30 00:50:20 +00:00
Chris Lattner
adf33d42ed Eliminate the dropInstruction method, which is not needed any more.
Fix a subtle iterator invalidation bug I introduced in the last commit.

llvm-svn: 60258
2008-11-29 23:30:39 +00:00
Chris Lattner
6d2b59a58f implement some fixme's: when deleting an instruction with
an entry in the nonlocal deps map, don't reset entries
referencing that instruction to [dirty, null], instead, set
them to [dirty,next] where next is the instruction after the
deleted one.  Use this information in the non-local deps
code to avoid rescanning entire blocks.

This speeds up GVN slightly by avoiding pointless work.  On
403.gcc this makes GVN 1.5% faster. 

llvm-svn: 60256
2008-11-29 22:02:15 +00:00
Chris Lattner
3e86ec7289 Change MemDep::getNonLocalDependency to return its results as
a smallvector instead of a DenseMap.  This speeds up GVN by 5%
on 403.gcc.

llvm-svn: 60255
2008-11-29 21:33:22 +00:00
Chris Lattner
ffc1af1619 reimplement getNonLocalDependency with a simpler worklist
formulation that is faster and doesn't require nonLazyHelper.
Much less code.

llvm-svn: 60253
2008-11-29 21:22:42 +00:00
Chris Lattner
0ac821f149 tidy up some variable names.
llvm-svn: 60243
2008-11-29 09:22:14 +00:00
Chris Lattner
5feffd1b9b rename some maps.
llvm-svn: 60242
2008-11-29 09:20:15 +00:00
Torok Edwin
7f54c665a2 protect against negative values that would exceed allowed bit width
llvm-svn: 60239
2008-11-29 08:52:45 +00:00
Chris Lattner
ce03bccd7e apparently GCC doesn't believe that I understand C
precedence rules.  Pacify it.

llvm-svn: 60237
2008-11-29 08:36:39 +00:00
Duncan Sands
845f6467ba Typo fix.
llvm-svn: 60236
2008-11-29 08:03:35 +00:00
Chris Lattner
96c72eef4b Split getDependency into getDependency and getDependencyFrom, the
former does caching, the later doesn't.  This dramatically simplifies
the logic in getDependency and getDependencyFrom.

llvm-svn: 60234
2008-11-29 03:47:00 +00:00
Chris Lattner
9e956ef129 Now that DepType is private, we can start cleaning up some of its uses:
Document the Dirty value more precisely, use it for the uninitialized
DepResultTy value.  Change reverse mappings to be from an instruction*
instead of DepResultTy, and stop tracking other forms.  This makes it more
clear that we only care about the instruction cases.

Eliminate a DepResultTy,bool pair by using Dirty in the local case as well,
shrinking the map and simplifying the code.

This speeds up GVN by ~3% on 403.gcc.

llvm-svn: 60232
2008-11-29 03:22:12 +00:00
Chris Lattner
6bf62f050c Introduce and use a new MemDepResult class to hold the results of a memdep
query.  This makes it crystal clear what cases can escape from MemDep that
the clients have to handle.  This also gives the clients a nice simplified
interface to it that is easy to poke at.

This patch also makes DepResultTy and MemoryDependenceAnalysis::DepType
private, yay.

llvm-svn: 60231
2008-11-29 02:29:27 +00:00
Chris Lattner
e9295510b5 Reimplement the internal abstraction used by MemDep in terms
of a pointer/int pair instead of a manually bitmangled pointer.
This forces clients to think a little more about checking the 
appropriate pieces and will be useful for internal 
implementation improvements later.

I'm not particularly happy with this.  After going through this
I don't think that the clients of memdep should be exposed to
the internal type at all.  I'll fix this in a subsequent commit.

This has no functionality change.

llvm-svn: 60230
2008-11-29 01:43:36 +00:00
Chris Lattner
7ae87447ed Fix sentinels to use correctly 'aligned' pointers.
llvm-svn: 60229
2008-11-29 01:36:16 +00:00
Chris Lattner
070df849e9 Fix spello, add DenseMapInfo specialization for PointerIntPair.
llvm-svn: 60228
2008-11-29 01:18:05 +00:00
Chris Lattner
b41c45dbdf fix comment typo
llvm-svn: 60227
2008-11-28 23:57:26 +00:00
Chris Lattner
507e71fce3 fix a bug.
llvm-svn: 60225
2008-11-28 23:36:15 +00:00
Chris Lattner
d8b755ed95 add a generic "bitmangled pointer" class, which allows a parameterized
pointer and integer type to be used.

llvm-svn: 60224
2008-11-28 23:31:44 +00:00
Chris Lattner
7376e32840 comment cleanups.
llvm-svn: 60220
2008-11-28 22:41:36 +00:00
Chris Lattner
8fc7870ff1 forward declare CallSite instead of #includ'ing it.
llvm-svn: 60217
2008-11-28 21:47:19 +00:00
Chris Lattner
cc3a3c0c98 rename "ping" to "verifyRemoved". I don't know why 'ping' what chosen,
but it doesn't make any sense at all.

Also make the method const, private, and fit in 80 cols while we're at it.

llvm-svn: 60215
2008-11-28 21:42:09 +00:00
Chris Lattner
b9ef82dada comment and indentation improvements.
llvm-svn: 60214
2008-11-28 21:36:43 +00:00
Mikhail Glushenkov
187b171022 Add 'hidden' and 'really_hidden' option properties.
llvm-svn: 60198
2008-11-28 00:13:25 +00:00
Chris Lattner
8b382de4e0 Enhance RecursivelyDeleteTriviallyDeadInstructions to optionally
return a list of deleted instructions.

llvm-svn: 60193
2008-11-27 23:14:34 +00:00
Chris Lattner
b374a0158a remove doConstantPropagation and dceInstruction, they are just
wrappers around the interesting code and use an obscure iterator
abstraction that dates back many many years.

Move EraseDeadInstructions to Transforms/Utils and name it
RecursivelyDeleteTriviallyDeadInstructions.

llvm-svn: 60191
2008-11-27 22:57:53 +00:00
Chris Lattner
dd755c74d6 improve const correctness.
llvm-svn: 60168
2008-11-27 08:39:18 +00:00
Chris Lattner
577096bcaa move FindAvailableLoadedValue from JumpThreading to Transforms/Utils.
llvm-svn: 60166
2008-11-27 08:10:05 +00:00
Chris Lattner
bb86dff3fe move MergeBasicBlockIntoOnlyPred to Transforms/Utils.
llvm-svn: 60162
2008-11-27 07:43:12 +00:00
Evan Cheng
f18016728c On x86 favors folding short immediate into some arithmetic operations (e.g. add, and, xor, etc.) because materializing an immediate in a register is expensive in turns of code size.
e.g.
movl 4(%esp), %eax
addl $4, %eax

is 2 bytes shorter than

movl $4, %eax
addl 4(%esp), %eax

llvm-svn: 60139
2008-11-27 00:49:46 +00:00
Ted Kremenek
d0f8118dc1 Add typedef to StringMapEntry.
llvm-svn: 60134
2008-11-27 00:17:25 +00:00
Mikhail Glushenkov
869ded12c8 Disallow multiple edges.
llvm-svn: 60127
2008-11-26 22:59:45 +00:00
Devang Patel
02a25292de Fix typo.
llvm-svn: 60111
2008-11-26 18:13:11 +00:00
Mikhail Glushenkov
01a62b9117 Fix the -I option (llvmc -I dir1 -I dir2 didn't work).
llvm-svn: 60101
2008-11-26 10:57:31 +00:00
Mikhail Glushenkov
3dd6b7e4e9 Refactor Tools.td to remove repetition.
llvm-svn: 60100
2008-11-26 10:56:56 +00:00
Dan Gohman
7b56f8686f LiveRanges are represented as half-open ranges. Fix the findLiveInMBBs code
and the LiveInterval.h top-level comment and accordingly. This fixes blocks
having spurious live-in registers in boundary cases.

llvm-svn: 60092
2008-11-26 05:50:31 +00:00
Ted Kremenek
b31e49cd47 Add 'tell' method to raw_fd_ostream that clients can use to query the current location in the file the stream is writing to.
llvm-svn: 60085
2008-11-26 03:33:13 +00:00
Chris Lattner
c9d864b689 add a long-overdue AllocaInst::isStaticAlloca method.
llvm-svn: 60080
2008-11-26 02:54:17 +00:00
Nuno Lopes
821f6d257e change AnnotationManager to use 'const char*' instead of std::string. this fixes the leakage of those strings and avoids the creation of such strings in static cosntructors (should result in a little improvement of startup time)
llvm-svn: 60064
2008-11-26 00:00:44 +00:00
Mikhail Glushenkov
bcf77dcb9a Make -fsyntax-only, -include and -emit-llvm work for C++ and Objective-C/C++.
llvm-svn: 60047
2008-11-25 21:35:20 +00:00
Dan Gohman
92cedc8a95 Initial support for anti-dependence breaking. Currently this code does not
introduce any new spilling; it just uses unused registers.

Refactor the SUnit topological sort code out of the RRList scheduler and
make use of it to help with the post-pass scheduler.

llvm-svn: 59999
2008-11-25 00:52:40 +00:00
Dan Gohman
07c5a496e4 Move the scheduler constructor functions to SchedulerRegistry.h, to
simplify header dependencies for front-ends that just want to choose
a scheduler and don't need all the scheduling machinery declarations.

llvm-svn: 59978
2008-11-24 19:53:21 +00:00
Dan Gohman
f084381b98 Fix an unused-parameter warning.
llvm-svn: 59977
2008-11-24 19:51:59 +00:00