Commit Graph

12401 Commits

Author SHA1 Message Date
Owen Anderson
826c148aa5 Add an erase() method to llvm::ThreadLocal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109686 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 22:49:43 +00:00
Owen Anderson
e850e6e162 Add more doxygen comments for llvm::ThreadLocal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109683 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 22:30:53 +00:00
Dan Gohman
5d414b44fc Move MaximumAlignment to Value.h, now that GlobalValue.h needs it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109656 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 21:02:38 +00:00
Dan Gohman
6bbe671e1c Make GlobalValue alignment consistent with load, store, and alloca
alignment, fixing silent truncation of alignment values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109653 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 20:56:48 +00:00
Kevin Enderby
7cbf73a73f Added first bit of support for the dwarf .file directive. This patch collects
the info from the .file directive and makes file and directory tables that
will eventually be put out as part of the dwarf info in the output file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109651 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 20:55:35 +00:00
Daniel Dunbar
36880e704f MC: Put back the MCFragment vtable, so subclasses are destroyed properly (duh).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109649 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 20:28:45 +00:00
Dan Gohman
138aa2a82b Define a maximum supported alignment value for load, store, and
alloca instructions (constrained by their internal encoding),
and add error checking for it. Fix an instcombine bug which
generated huge alignment values (null is infinitely aligned).
This fixes undefined behavior noticed by John Regehr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109643 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 20:12:04 +00:00
Dan Gohman
dc7a235363 Add some extra friend declarations to fix a gcc-4.0 compile error.
This is a temporary fix, until more elaborate changes are ready.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109593 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 17:09:24 +00:00
Daniel Dunbar
a309dac868 Support: Add CrashRecoveryContext helper object.
- Designed as a simple wrapper to allow clients to attempt to catch crashes
   (memory errors, assertion violations, etc.) and do some kind of recovery.

 - Currently doesn't actually attempt to catch crashes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109586 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 15:40:20 +00:00
Gabor Greif
756f0d2ab4 we are supposed to only create proper CallSites from an instruction (esp. CallInst and InvokeInst)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109576 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 10:44:59 +00:00
Dan Gohman
f374ba2bcd Add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109565 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 00:21:18 +00:00
Owen Anderson
cf85c96129 Fill out the interface of DenseSet a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109562 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 23:55:47 +00:00
Gabor Greif
b344a346f1 reintroduce original (asserting) semantics of CallSite(Instruction *II)
add instead a CallSite(Value* V) constructor that is consistent with ImmutableCallSize
and use that one in client code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109553 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 22:53:28 +00:00
Gabor Greif
a6758446b7 remove bogus assert, use static_cast for additional checking
left two new asserts commented out, because they would fire in clang, have to hunt those down first

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109544 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 21:46:11 +00:00
Chris Lattner
90f8795e1c make lookup failures not fatal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109530 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 18:59:50 +00:00
Mikhail Glushenkov
67d985ffb2 Return -1 only on failure to execute a program.
Also fix some comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109499 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 11:19:36 +00:00
Duncan Sands
978bb87f88 In commit 91421, isPod was changed from false to true for these value handles.
Change it back again: destructors and constructors need to be run.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109498 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 09:09:05 +00:00
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