Commit Graph

7717 Commits

Author SHA1 Message Date
Chris Lattner
0e0a5b690c REmove an old fixme, resolve another fixme by adding liberal
comments about what this class does.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60264 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 01:17:08 +00:00
Chris Lattner
b911824620 fix indentation. std::pair is "isPod" if the first/second are both isPod.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60262 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 00:50:20 +00:00
Chris Lattner
4f8c18c7c7 Eliminate the dropInstruction method, which is not needed any more.
Fix a subtle iterator invalidation bug I introduced in the last commit.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60258 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 23:30:39 +00:00
Nick Lewycky
4fd40e884c Add protected visibility to libLTO.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60257 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 22:49:59 +00:00
Chris Lattner
0ec48ddef2 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. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60256 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 22:02:15 +00:00
Chris Lattner
396a4a55e5 Change MemDep::getNonLocalDependency to return its results as
a smallvector instead of a DenseMap.  This speeds up GVN by 5%
on 403.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60255 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 21:33:22 +00:00
Chris Lattner
86b29ef64a reimplement getNonLocalDependency with a simpler worklist
formulation that is faster and doesn't require nonLazyHelper.
Much less code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60253 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 21:22:42 +00:00
Chris Lattner
233336ebc5 tidy up some variable names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60243 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 09:22:14 +00:00
Chris Lattner
8c4652790e rename some maps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60242 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 09:20:15 +00:00
Torok Edwin
10ca770020 protect against negative values that would exceed allowed bit width
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60239 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 08:52:45 +00:00
Chris Lattner
b9cf75a15f apparently GCC doesn't believe that I understand C
precedence rules.  Pacify it.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60237 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 08:36:39 +00:00
Duncan Sands
3f7dba7b17 Typo fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60236 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 08:03:35 +00:00
Chris Lattner
5391a1d804 Split getDependency into getDependency and getDependencyFrom, the
former does caching, the later doesn't.  This dramatically simplifies
the logic in getDependency and getDependencyFrom.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60234 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 03:47:00 +00:00
Chris Lattner
7f52422a3c 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60232 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 03:22:12 +00:00
Chris Lattner
4c72400625 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60231 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 02:29:27 +00:00
Chris Lattner
39f372e23e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60230 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 01:43:36 +00:00
Chris Lattner
d63e618212 Fix sentinels to use correctly 'aligned' pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60229 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 01:36:16 +00:00
Chris Lattner
9ac30537aa Fix spello, add DenseMapInfo specialization for PointerIntPair.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60228 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 01:18:05 +00:00
Chris Lattner
d55da4de04 fix comment typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60227 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 23:57:26 +00:00
Chris Lattner
762ac83271 fix a bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60225 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 23:36:15 +00:00
Chris Lattner
34b763694e add a generic "bitmangled pointer" class, which allows a parameterized
pointer and integer type to be used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60224 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 23:31:44 +00:00
Chris Lattner
956033a4f5 comment cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60220 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 22:41:36 +00:00
Chris Lattner
b390b1728e forward declare CallSite instead of #includ'ing it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60217 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 21:47:19 +00:00
Chris Lattner
8b589fa135 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60215 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 21:42:09 +00:00
Chris Lattner
e85866313a comment and indentation improvements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60214 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 21:36:43 +00:00
Mikhail Glushenkov
739c720e66 Add 'hidden' and 'really_hidden' option properties.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60198 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 00:13:25 +00:00
Chris Lattner
4f02c74a8e Enhance RecursivelyDeleteTriviallyDeadInstructions to optionally
return a list of deleted instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60193 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 23:14:34 +00:00
Chris Lattner
3481f24c06 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60191 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 22:57:53 +00:00
Chris Lattner
e3a0884ddf improve const correctness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60168 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 08:39:18 +00:00
Chris Lattner
52c95856b4 move FindAvailableLoadedValue from JumpThreading to Transforms/Utils.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60166 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 08:10:05 +00:00
Chris Lattner
b29714a10a move MergeBasicBlockIntoOnlyPred to Transforms/Utils.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60162 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 07:43:12 +00:00
Evan Cheng
884c70c912 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60139 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 00:49:46 +00:00
Ted Kremenek
9f1f00ab1b Add typedef to StringMapEntry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60134 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 00:17:25 +00:00
Mikhail Glushenkov
7e6d70a425 Disallow multiple edges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60127 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 22:59:45 +00:00
Devang Patel
da278753c4 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60111 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 18:13:11 +00:00
Mikhail Glushenkov
1f1fab8c91 Fix the -I option (llvmc -I dir1 -I dir2 didn't work).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60101 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 10:57:31 +00:00
Mikhail Glushenkov
8b4c5f5d26 Refactor Tools.td to remove repetition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60100 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 10:56:56 +00:00
Dan Gohman
2ad8245566 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60092 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 05:50:31 +00:00
Ted Kremenek
5984680c1f Add 'tell' method to raw_fd_ostream that clients can use to query the current location in the file the stream is writing to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60085 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 03:33:13 +00:00
Chris Lattner
c5dd22a333 add a long-overdue AllocaInst::isStaticAlloca method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60080 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 02:54:17 +00:00
Nuno Lopes
08d67c7763 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)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60064 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 00:00:44 +00:00
Mikhail Glushenkov
d91487785f Make -fsyntax-only, -include and -emit-llvm work for C++ and Objective-C/C++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60047 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 21:35:20 +00:00
Dan Gohman
21d9003087 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59999 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 00:52:40 +00:00
Dan Gohman
ad38b6e4e5 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59978 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 19:53:21 +00:00
Dan Gohman
d59b083d22 Fix an unused-parameter warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59977 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 19:51:59 +00:00
Dan Gohman
942b8c8533 Check in the rest of this change. The isAntiDep flag needs to be passed
to removePred because an SUnit can both data-depend and anti-depend
on the same SUnit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59969 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 17:33:52 +00:00
Duncan Sands
25cf2275ff If the type legalizer actually legalized anything
(this doesn't happen that often, since most code
does not use illegal types) then follow it by a
DAG combiner run that is allowed to generate
illegal operations but not illegal types.  I didn't
modify the target combiner code to distinguish like
this between illegal operations and illegal types,
so it will not produce illegal operations as well
as not producing illegal types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59960 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 14:53:14 +00:00
Evan Cheng
027fdbe3ba Move target independent td files from lib/Target/ to include/llvm/Target so they can be distributed along with the header files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59953 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 07:34:46 +00:00
Scott Michel
2cd91804ec Roll back rev 59890, since Chris says this can never happen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59914 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 19:22:48 +00:00
Duncan Sands
03228089d5 Rename SetCCResultContents to BooleanContents. In
practice these booleans are mostly produced by SetCC,
however the concept is more general.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59911 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 15:47:28 +00:00