Commit Graph

10236 Commits

Author SHA1 Message Date
Victor Hernandez 8acf2956b8 Remove AllocationInst. Since MallocInst went away, AllocaInst is the only subclass of AllocationInst, so it no longer is necessary.
llvm-svn: 84969
2009-10-23 21:09:37 +00:00
Jeffrey Yasskin 61ade25834 Fix stylistic and documentation problems in ValueMap found by Nick Lewycky and
Evan Cheng.

llvm-svn: 84967
2009-10-23 20:54:00 +00:00
David Goodwin 02ad4cb32e Allow the target to select the level of anti-dependence breaking that should be performed by the post-RA scheduler. The default is none.
llvm-svn: 84911
2009-10-22 23:19:17 +00:00
Jeffrey Yasskin 4546d31235 Try r84890 again (adding ValueMap<>), now that I've tested the compile on
gcc-4.4.

llvm-svn: 84902
2009-10-22 22:11:22 +00:00
Eric Christopher 9d2acced69 size_t, not unsigned here to silence a warning.
llvm-svn: 84900
2009-10-22 22:06:50 +00:00
Benjamin Kramer ab304c9237 Random include cleanup.
llvm-svn: 84898
2009-10-22 21:49:41 +00:00
Jeffrey Yasskin 66db004d7e Revert r84890, which broke the linux build.
llvm-svn: 84892
2009-10-22 20:23:43 +00:00
Jeffrey Yasskin 6b80e6e2b7 Add a ValueMap<ValueOrSubclass*, T> type. ValueMap<Value*, T> is safe to use
even when keys get RAUWed and deleted during its lifetime. By default the keys
act like WeakVHs, but users can pass a third template parameter to configure
how updates work and whether to do anything beyond updating the map on each
action.

It's also possible to automatically acquire a lock around ValueMap updates
triggered by RAUWs and deletes, to support the ExecutionEngine.

llvm-svn: 84890
2009-10-22 20:10:20 +00:00
Devang Patel 1155fdf6dc Hide MetadataContext implementation details.
llvm-svn: 84886
2009-10-22 19:36:54 +00:00
Devang Patel 6da5dbf3c2 Fix getMDs() interface such that it does not expose implementation details.
llvm-svn: 84885
2009-10-22 18:55:16 +00:00
Devang Patel 084679e70a Using TrackingVH instead of WeakVH or WeakMetadataVH.
llvm-svn: 84884
2009-10-22 18:25:28 +00:00
Devang Patel 09c319e269 Sort handler names to ensure deterministic behavior.
llvm-svn: 84878
2009-10-22 17:40:37 +00:00
Chris Lattner 1664a4fd86 Move some constant folding logic for loads out of instcombine into
Analysis/ConstantFolding.cpp.  This doesn't change the behavior of
instcombine but makes other clients of ConstantFoldInstruction
able to handle loads.  This was partially extracted from Eli's patch
in PR3152.

llvm-svn: 84836
2009-10-22 06:25:11 +00:00
Mikhail Glushenkov 2300f65e8c Forgot a declaration.
llvm-svn: 84828
2009-10-22 04:15:24 +00:00
Devang Patel 0fffb49d56 Fix getHandlerNames() interface. Now it populate clinet supplied small vector with handler names.
llvm-svn: 84820
2009-10-22 01:01:24 +00:00
Devang Patel 6746d43a3f Use StringRef to construct MDString.
llvm-svn: 84811
2009-10-22 00:22:05 +00:00
Devang Patel dcb99d310a Remove meaningless const.
Pass StringRef by value.

llvm-svn: 84804
2009-10-22 00:10:15 +00:00
Devang Patel 27e0be274e Derive metadata hierarchy from Value instead of User.
llvm-svn: 84801
2009-10-21 23:57:35 +00:00
Dale Johannesen 1cfb958b00 Rename msasm to alignstack per review.
llvm-svn: 84795
2009-10-21 23:28:00 +00:00
Devang Patel 2505c1e17a Use StringRef.
llvm-svn: 84786
2009-10-21 21:57:13 +00:00
Devang Patel 49914e6eb3 Do not use SmallVector to store MDNode elements.
llvm-svn: 84784
2009-10-21 21:25:09 +00:00
Devang Patel 3eb5d33b65 Incorporate various suggestions Chris gave during metadata review.
- i < getNumElements()  instead of getNumElements() > i
- Make setParent() private
- Fix use of resizeOperands
- Reset HasMetadata bit after removing all metadata attached to an instruction
- Efficient use of iterators

llvm-svn: 84765
2009-10-21 17:33:41 +00:00
Jeffrey Yasskin 08fa03c740 Delete the MacOSJITEventListener per echristo's request. It was disabled by
default and didn't work anyway.

llvm-svn: 84720
2009-10-21 00:43:48 +00:00
Devang Patel 0c35dbdf03 Cosmetic changes.
s/validName/isValidName/g
s/with an Instruction/to an Instruction/g
s/RegisterMDKind/registerMDKind/g

llvm-svn: 84689
2009-10-20 22:50:27 +00:00
Jeffrey Yasskin 27c669242a Move the Function*->allocated blocks map from the JITMemoryManager to the
JITEmitter.

I'm gradually making Functions auto-remove themselves from the JIT when they're
destroyed. In this case, the Function needs to be removed from the JITEmitter,
but the map recording which Functions need to be removed lived behind the
JITMemoryManager interface, which made things difficult.

This patch replaces the deallocateMemForFunction(Function*) method with a pair
of methods deallocateFunctionBody(void *) and deallocateExceptionTable(void *)
corresponding to the two startFoo/endFoo pairs.

llvm-svn: 84651
2009-10-20 18:13:21 +00:00
Benjamin Kramer 3301207a15 Random #include pruning.
llvm-svn: 84632
2009-10-20 11:44:38 +00:00
Daniel Dunbar f0b3d15cfe Wire up the ARM MCInst printer, for llvm-mc.
llvm-svn: 84600
2009-10-20 05:15:36 +00:00
Dan Gohman d383c2f6ba Add getTopBlock and getBottomBlock member functions to MachineLoopInfo.
llvm-svn: 84596
2009-10-20 04:16:37 +00:00
Chris Lattner 86dfd73c38 add a twine version of MCContext::GetOrCreateSymbol.
llvm-svn: 84561
2009-10-19 22:49:00 +00:00
Jim Grosbach 5a5a3bc5d4 Adjust the scavenge register spilling to allow the target to choose an
appropriate restore location for the spill as well as perform the actual
save and restore.

The Thumb1 target uses this to make sure R12 is not clobbered while a spilled
scavenger register is live there.

llvm-svn: 84554
2009-10-19 22:27:30 +00:00
Jeffrey Yasskin 7d2edada7f Clean up the JITResolver stub/callsite<->function maps.
The JITResolver maps Functions to their canonical stubs and all callsites for
lazily-compiled functions to their target Functions. To make Function
destruction work, I'm going to need to remove all callsites on destruction, so
this patch also adds the reverse mapping for that.

There was an incorrect assumption in here that the only stub for a function
would be the one caused by needing to lazily compile it, while x86-64 far calls
and dlsym-stubs could also cause such stubs, but I didn't look for a test case
that the assumption broke.

This also adds DenseMapInfo<AssertingVH> so I can use DenseMaps instead of
std::maps.

llvm-svn: 84522
2009-10-19 18:49:59 +00:00
Chris Lattner b0c23e81e7 various cleanups.
llvm-svn: 84471
2009-10-19 07:10:59 +00:00
Evan Cheng f0236e011e Spill slots cannot alias.
llvm-svn: 84432
2009-10-18 19:58:47 +00:00
Evan Cheng 0e9d9ca855 -Revert parts of 84326 and 84411. Distinquishing between fixed and non-fixed
stack slots and giving them different PseudoSourceValue's did not fix the
problem of post-alloc scheduling miscompiling llvm itself.
- Apply Dan's conservative workaround by assuming any non fixed stack slots can
alias other memory locations. This means a load from spill slot #1 cannot 
move above a store of spill slot #2. 
- Enable post-alloc scheduling for x86 at optimization leverl Default and above.

llvm-svn: 84424
2009-10-18 18:16:27 +00:00
Chris Lattner 3462d75aab punctuate properly
llvm-svn: 84407
2009-10-18 05:08:07 +00:00
Chris Lattner 1fa98f0d74 remove the IndMemRemPass, which only made sense for when malloc/free were intrinsic
instructions.

llvm-svn: 84404
2009-10-18 05:02:09 +00:00
Chris Lattner 9e6882c8de add function passes for printing various dominator datastructures
accessible through opt.  Patch by Tobias Grosser!

llvm-svn: 84397
2009-10-18 04:10:40 +00:00
Chris Lattner da42426e04 make DOTGraphTraits public, patch by Tobias Grosser!
llvm-svn: 84396
2009-10-18 04:09:11 +00:00
Chris Lattner d3400b4c86 add nodes_begin/end/iterator for dominfo, patch by Tobias Grosser!
llvm-svn: 84395
2009-10-18 04:05:53 +00:00
Eric Christopher 4eafc31368 More warnings patrol: Another unused argument and more implicit
conversions.

llvm-svn: 84382
2009-10-17 23:56:18 +00:00
Nick Lewycky bb1410ea8b Fix test/Bindings/Ocaml/vmcore.ml. When IRBuilder::CreateMalloc was removed,
LLVMBuildMalloc was reimplemented but with the bug that it didn't insert the
resulting instruction.

llvm-svn: 84374
2009-10-17 23:52:26 +00:00
Daniel Dunbar 04f049f2f5 Move UnescapeString to a static function for its sole client; its inefficient and broken.
llvm-svn: 84358
2009-10-17 20:43:42 +00:00
Daniel Dunbar 59449581b2 Remove llvm::EscapeString, raw_ostream::write_escaped is much faster.
llvm-svn: 84357
2009-10-17 20:43:29 +00:00
Daniel Dunbar 4108c43fd1 Add raw_ostream::write_escaped, for writing escaped strings.
llvm-svn: 84355
2009-10-17 20:43:08 +00:00
Mikhail Glushenkov 867f67301b First draft of the OptionPreprocessor.
More to follow...

llvm-svn: 84352
2009-10-17 20:09:29 +00:00
Daniel Dunbar 77668004c4 Move StringMap's string has function into StringExtras.h
llvm-svn: 84344
2009-10-17 18:21:06 +00:00
Evan Cheng 4729191bb2 Distinquish stack slots from other stack objects. They (and fixed objects) get FixedStack PseudoSourceValues.
llvm-svn: 84326
2009-10-17 09:20:14 +00:00
Evan Cheng 5119ce2d16 Re-arrange some fields.
llvm-svn: 84324
2009-10-17 08:57:09 +00:00
Daniel Dunbar 235889151b Add another required #include for freestanding .h files.
llvm-svn: 84322
2009-10-17 08:12:36 +00:00
Evan Cheng 8759585aba Revert 84315 for now. Re-thinking the patch.
llvm-svn: 84321
2009-10-17 07:53:04 +00:00