Commit Graph

12384 Commits

Author SHA1 Message Date
Tobias Grosser
0e6fcf4be3 RegionInfo: Add getMaxRegionExit()
getMaxRegionExit returns the exit of the maximal refined region starting
at a specific basic block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109496 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 08:39:43 +00:00
Tobias Grosser
082d587d35 Add function to query RegionInfo about loops.
* contains(Loop), * getOutermostLoop()
* Improve getNameStr() to return a sensible name, if basic blocks are not named.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109490 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 04:17:13 +00:00
Bill Wendling
dfc2c51d12 It's better to have the arrays, which would trigger the creation of stack
protectors, to be near the stack protectors on the stack. Accomplish this by
tagging the stack object with a predicate that indicates that it would trigger
this. In the prolog-epilog inserter, assign these objects to the stack after the
stack protector but before the other objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109481 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 01:55:19 +00:00
Dan Gohman
ab28928fe2 Use AssertingVH for InsertedValues and InsertedPostIncValues, to verify
that the values they refer to aren't being deleted underneath them.

Make sure these containters get cleared by clear(), which IndVarSimplify
and LSR both use before deleting instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109478 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 01:19:06 +00:00
Dan Gohman
72eb300715 Add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109435 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 21:05:37 +00:00
Gabor Greif
05006e2813 re-commit r109220, the compile error has already been fixed
Simplifying use_iterators by dereferencing
is not a good idea. The codebase does not depend
in this any more, and it may introduce hidden
runtime cost. If you get compile errors, please
dereference your iterator before passing to cast<>
(and friends).

Also: please consider caching the result of
operator* and reusing that instead of dereferencing
many times.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109425 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 18:48:07 +00:00
Owen Anderson
cfa7fb6df5 Add an initial implementation of LazyValueInfo updating for JumpThreading. Disabled for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109424 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 18:48:03 +00:00
Dan Gohman
052f000158 Remove LCSSA's bogus dependence on LoopSimplify and LoopSimplify's bogus
dependence on DominanceFrontier. Instead, add an explicit DominanceFrontier
pass in StandardPasses.h to ensure that it gets scheduled at the right
time.

Declare that loop unrolling preserves ScalarEvolution, and shuffle some
getAnalysisUsages.

This eliminates one LoopSimplify and one LCCSA run in the standard
compile opts sequence.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109413 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 18:11:16 +00:00
Michael J. Spencer
801a359116 MC: Add WinCOFFObjectWriter implementation.
Origonal Windows COFF implementation by Nathan Jedffords.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109389 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 02:17:32 +00:00
Lang Hames
6f4e4df100 Factored out a bit of common code to mark VNInfos for deletion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109388 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 01:49:41 +00:00
Anton Korobeynikov
cec36f4c11 Hook in GlobalMerge pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109359 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-24 21:52:08 +00:00
Anton Korobeynikov
8c64b9766e Add hook to insert late LLVM=>LLVM passes just before isel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109354 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-24 20:48:54 +00:00
Chris Lattner
1ec9e6a5dc add a new NullablePtr class which makes it more obvious in API
that a pointer can be null, forcing clients to think about it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109348 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-24 18:47:46 +00:00
Evan Cheng
70017e44cd Add an ILP scheduler. This is a register pressure aware scheduler that's
appropriate for targets without detailed instruction iterineries.
The scheduler schedules for increased instruction level parallelism in
low register pressure situation; it schedules to reduce register pressure
when the register pressure becomes high.

On x86_64, this is a win for all tests in CFP2000. It also sped up 256.bzip2
by 16%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109300 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-24 00:39:05 +00:00
Owen Anderson
448e187499 Fix use-after-free error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109288 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 23:27:43 +00:00
Evan Cheng
3144687df7 - Allow target to specify when is register pressure "too high". In most cases,
it's too late to start backing off aggressive latency scheduling when most
  of the registers are in use so the threshold should be a bit tighter.
- Correctly handle live out's and extract_subreg etc.
- Enable register pressure aware scheduling by default for hybrid scheduler.
  For ARM, this is almost always a win on # of instructions. It's runtime
  neutral for most of the tests. But for some kernels with high register
  pressure it can be a huge win. e.g. 464.h264ref reduced number of spills by
  54 and sped up by 20%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109279 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 22:39:59 +00:00
Dan Gohman
f8336a75c2 Eliminate getCanonicalInductionVariableIncrement's last user and
eliminate it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109270 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 21:34:51 +00:00
Eric Christopher
3012e2213b Revert r109102 for now as it's causing JIT miscompilations.
I'll try to track down why a bit later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109223 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 12:16:56 +00:00
Eric Christopher
6252f6ea11 Revert 109220.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109221 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 08:53:17 +00:00
Gabor Greif
4a3bb24179 Simplifying use_iterators by dereferencing
is not a good idea. The codebase does not depend
in this any more, and it may introduce hidden
runtime cost. If you get compile errors, please
dereference your iterator before passing to cast<>
(and friends).

Also: please consider caching the result of
operator* and reusing that instead of dereferencing
many times.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109220 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 08:36:07 +00:00
Mikhail Glushenkov
7d455eb7a4 StringRef'icate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109217 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 04:19:39 +00:00
Mikhail Glushenkov
b374d4fd82 Get rid of exceptions in llvmc.
llvmc can be now compiled with llvm-gcc on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109215 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 03:42:55 +00:00
Chris Lattner
a23650bc01 give StringMap a new ctor which allows you to initialize it
with an existing allocator.  The interesting use case of this
is that it allows "StringMap<whatever, BumpPtrAllocator&>" for
when you want to allocate out of a preexisting bump pointer
allocator owned by someone else.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109213 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 03:29:59 +00:00
Chris Lattner
d69121b3c5 modernize stringset interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109212 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 03:21:53 +00:00
Eric Christopher
ed2b84087f Warnings patrol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109174 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 21:51:30 +00:00
Chris Lattner
2062875a7d eliminate the TargetInstrInfo::GetInstSizeInBytes hook.
ARM/PPC/MSP430-specific code (which are the only targets that
implement the hook) can directly reference their target-specific
instrinfo classes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109171 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 21:27:00 +00:00
Chris Lattner
134d8eec87 remove the JIT "NeedsExactSize" feature and supporting logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109167 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 21:17:55 +00:00
Gabor Greif
1ac022974a fit in 80 columns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109108 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 14:13:14 +00:00
Duncan Sands
907cd1a569 Increase the max physreg size. Patch by Pekka Jääskeläinen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109102 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 13:10:14 +00:00
Tobias Grosser
f96b006367 Add new RegionInfo pass.
The RegionInfo pass detects single entry single exit regions in a function,
where a region is defined as any subgraph that is connected to the remaining
graph at only two spots.
Furthermore an hierarchical region tree is built.
Use it by calling "opt -regions analyze" or "opt -view-regions".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109089 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 07:46:31 +00:00
Reid Kleckner
c96a82a534 Initial modifications to MCAssembler and TargetMachine for the MCJIT.
Patch by Olivier Meurant!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109080 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 05:58:53 +00:00
Lang Hames
624e0b2be6 If 'other' was empty 'overlapsFrom(other, other.begin());' will segfault. This avoids that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109075 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 02:05:10 +00:00
Dan Gohman
17aa92c92a Make NamedMDNode not be a subclass of Value, and simplify the interface
for creating and populating NamedMDNodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109061 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 23:38:33 +00:00
Owen Anderson
d8cc7be026 Add INSTANTIATE_AG_PASS, which combines RegisterPass<> with RegisterAnalysisGroup<> for pass registration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109058 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 23:07:00 +00:00
Jim Grosbach
917290043f For ARM/Darwin, add a dwarf entry indicating whether a function is arm or thumb
rdar://8202967

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109057 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 23:03:52 +00:00
Jim Grosbach
6215109cd9 tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109042 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 22:04:53 +00:00
Owen Anderson
bdd57371bc Add the INITIALIZE_PASS macro.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109034 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 20:46:41 +00:00
Dan Gohman
872814ae04 Disallow null as a named metadata operand.
Make MDNode::destroy private.
Fix the one thing that used MDNode::destroy, outside of MDNode itself.

One should never delete or destroy an MDNode explicitly. MDNodes
implicitly go away when there are no references to them (implementation
details aside).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109028 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 18:54:18 +00:00
Daniel Dunbar
ec237ffd28 Use System/DataTypes.h instead of stdint.h, which isn't portable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109026 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 18:48:59 +00:00
Dan Gohman
d9c86dc6d9 Use TrackingVH instead of WeakVH for NamedMDNode's operands, since nodes
referenced by NamedMDNodes shouldn't be deleted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109021 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 18:01:42 +00:00
Owen Anderson
9650983b9a Move the smarts of AnalysisGroup registration into PassRegistry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109019 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 17:52:45 +00:00
Dan Gohman
4595321521 Delete an obsolete comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109017 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 17:21:27 +00:00
Gabor Greif
c61f6b424b restore aesthetics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109001 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 08:25:55 +00:00
Evan Cheng
4f6b4674be Teach bottom up pre-ra scheduler to track register pressure. Work in progress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108991 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 06:09:07 +00:00
Owen Anderson
539673579e Move the handling of PassRegistrationListener's to PassRegistry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108966 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 23:41:56 +00:00
Greg Clayton
98cfb53af4 Added support to MachO.h for many defines and structures that are needed
to Parse mach-o files. All defines have been renamed to not conflict with
#defines in mach header files, all structures were left named the same but
are in the llvm::MachO namespace.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108953 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 22:36:00 +00:00
Dan Gohman
4f1be4abba Rename removeAllMetadata to clearMetadataHashEntries and simplify
it to just do the things that need to be done when an instruction
is deleted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108948 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 22:25:04 +00:00
Jakob Stoklund Olesen
6a0dc079ef Implement loop splitting analysis.
Determine which loop exit blocks need a 'pre-exit' block inserted.
Recognize when this would be impossible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108941 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 21:46:58 +00:00
Dan Gohman
5d80911983 Remove an obsolete comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108940 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 21:45:17 +00:00
Dan Gohman
19538d1e9f Add support for remapping metadata kind IDs when reading in a
bitcode file, so that two bitcode files where the same metadata kind
name happens to have been assigned a different ID can still be
linked together.

Eliminate the restriction that metadata kind IDs can't be 0.

Change MD_dbg from 1 to 0, because we can now, and because it's
less mysterious that way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108939 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 21:42:28 +00:00