Commit Graph

10254 Commits

Author SHA1 Message Date
Chris Lattner
7c5b021793 add a twine version of MCContext::GetOrCreateSymbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84561 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:49:00 +00:00
Jim Grosbach
d482f55af1 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84554 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:27:30 +00:00
Jeffrey Yasskin
ebbcef945d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84522 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 18:49:59 +00:00
Chris Lattner
b2a33b4646 various cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84471 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 07:10:59 +00:00
Evan Cheng
38bdfc69cb Spill slots cannot alias.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84432 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 19:58:47 +00:00
Evan Cheng
ff89dcb06f -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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84424 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 18:16:27 +00:00
Chris Lattner
14d8038518 punctuate properly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84407 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 05:08:07 +00:00
Chris Lattner
98b532cf33 remove the IndMemRemPass, which only made sense for when malloc/free were intrinsic
instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84404 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 05:02:09 +00:00
Chris Lattner
b839c5577d add function passes for printing various dominator datastructures
accessible through opt.  Patch by Tobias Grosser!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84397 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 04:10:40 +00:00
Chris Lattner
88067b9133 make DOTGraphTraits public, patch by Tobias Grosser!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84396 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 04:09:11 +00:00
Chris Lattner
f0d24f1f59 add nodes_begin/end/iterator for dominfo, patch by Tobias Grosser!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84395 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 04:05:53 +00:00
Eric Christopher
3a8ff4c8b6 More warnings patrol: Another unused argument and more implicit
conversions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84382 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 23:56:18 +00:00
Nick Lewycky
3fc35c594c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84374 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 23:52:26 +00:00
Daniel Dunbar
9bd34602fb Move UnescapeString to a static function for its sole client; its inefficient and broken.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84358 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 20:43:42 +00:00
Daniel Dunbar
ca107c5c18 Remove llvm::EscapeString, raw_ostream::write_escaped is much faster.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84357 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 20:43:29 +00:00
Daniel Dunbar
522b113a75 Add raw_ostream::write_escaped, for writing escaped strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84355 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 20:43:08 +00:00
Mikhail Glushenkov
0a22fb6664 First draft of the OptionPreprocessor.
More to follow...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84352 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 20:09:29 +00:00
Daniel Dunbar
4dee7fd2c2 Move StringMap's string has function into StringExtras.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84344 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 18:21:06 +00:00
Evan Cheng
491f54f1fd Distinquish stack slots from other stack objects. They (and fixed objects) get FixedStack PseudoSourceValues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84326 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 09:20:14 +00:00
Evan Cheng
a8e6542610 Re-arrange some fields.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84324 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 08:57:09 +00:00
Daniel Dunbar
985577ec13 Add another required #include for freestanding .h files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84322 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 08:12:36 +00:00
Evan Cheng
6553155172 Revert 84315 for now. Re-thinking the patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84321 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 07:53:04 +00:00
Evan Cheng
bf125583f8 Rename getFixedStack to getStackObject. The stack objects represented are not
necessarily fixed. Only those will negative frame indices are "fixed."


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84315 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 06:22:26 +00:00
Daniel Dunbar
ca24a695e7 Add required #includes for freestanding .h files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84302 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 03:28:07 +00:00
Victor Hernandez
a276c603b8 Remove MallocInst from LLVM Instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84299 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 01:18:07 +00:00
Dan Gohman
b68d67caf3 Add a splice member function which accepts a range instead of a
single iterator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84294 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 00:28:24 +00:00
Victor Hernandez
13ad5aaaff Autoupgrade malloc insts to malloc calls.
Update testcases that rely on malloc insts being present.

Also prematurely remove MallocInst handling from IndMemRemoval and RaiseAllocations to help pass tests in this incremental step.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84292 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 00:00:19 +00:00
Evan Cheng
fa16354e03 Change createPostRAScheduler so it can be turned off at llc -O1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84273 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 21:06:15 +00:00
Evan Cheng
bf57b52ba4 Add a CodeGenOpt::Less level to match -O1. It'll be used by clients which do not want post-regalloc scheduling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84272 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 21:02:20 +00:00
Duncan Sands
ed90342d8a Strip trailing white space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84256 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 15:20:13 +00:00
Chris Lattner
cc4287a374 Add half precision floating point support (float16) to APFloat,
patch by Peter Johnson! (PR5195)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84239 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 02:13:51 +00:00
Chris Lattner
a43fc3452b add haiku support, patch by Paul Davey!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84238 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 02:06:30 +00:00
Daniel Dunbar
7eb85194f2 Minor formatting tweaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84235 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 01:58:15 +00:00
Daniel Dunbar
1253a6fa3b MC: Switch assembler API to using MCExpr instead of MCValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84234 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 01:58:03 +00:00
Daniel Dunbar
e00b011e6a MC: Remove unneeded context argument to MCExpr::Evaluate*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84233 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 01:57:52 +00:00
Daniel Dunbar
7c3600de94 MC: Move assembler variable values from MCContext to MCSymbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84229 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 01:33:57 +00:00
Daniel Dunbar
e579849652 MC: Switch MCContext value table to storing MCExprs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84228 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 01:33:11 +00:00
Victor Hernandez
2491ce0353 Fix bug where array malloc with unexpected computation of the size argument resulted in MallocHelper
identifying the malloc as a non-array malloc.  This broke GlobalOpt's optimization of stores of mallocs 
to global variables.

The fix is to classify malloc's into 3 categories:
1. non-array mallocs
2. array mallocs whose array size can be determined
3. mallocs that cannot be determined to be of type 1 or 2 and cannot be optimized

getMallocArraySize() returns NULL for category 3, and all users of this function must avoid their 
malloc optimization if this function returns NULL.

Eventually, currently unexpected codegen for computing the malloc's size argument will be supported in
isArrayMalloc() and getMallocArraySize(), extending malloc optimizations to those examples.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84199 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 20:14:52 +00:00
Jakob Stoklund Olesen
6ad8c84d70 Move Blackfin intrinsics into the Target/Blackfin directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84194 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 18:50:52 +00:00
Jakob Stoklund Olesen
0383606b65 Clean up TargetIntrinsicInfo API. Add pure virtual methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84192 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 18:49:26 +00:00
Eric Christopher
085b9c034f One more iteration here and a yet better way to solve it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84150 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 22:14:18 +00:00
Eric Christopher
7a8a05b340 Fix the unused argument problem here a different way - cast to void.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84147 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 21:45:49 +00:00
Dan Gohman
d10e68c2cb Delete bogus semicolons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84132 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 20:39:01 +00:00
Eric Christopher
41b5adf202 Remove a bunch of unused arguments from functions, silencing a
warning.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84130 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 20:28:33 +00:00
Devang Patel
5db2c52270 Add copyMD to copy metadata from one instruction to another instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84113 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 17:02:49 +00:00
Duncan Sands
b01bbdcc1a I don't see any point in having both eh.selector.i32 and eh.selector.i64,
so get rid of eh.selector.i64 and rename eh.selector.i32 to eh.selector.
Likewise for eh.typeid.for.  This aligns us with gcc, which always uses a
32 bit value for the selector on all platforms.  My understanding is that
the register allocator used to assert if the selector intrinsic size didn't
match the pointer size, and this was the reason for introducing the two
variants.  However my testing shows that this is no longer the case (I
fixed some bugs in selector lowering yesterday, and some more today in the
fastisel path; these might have caused the original problems).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84106 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 16:11:37 +00:00
Edward O'Callaghan
5da60469f9 Undo pthread patch from rev. 83930 & 83823. Credit to Paul Davey.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84083 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 11:12:33 +00:00
Dan Gohman
68cf03a314 Fix resetCachedCostInfo to reset all of the cost information, instead of
just the NumBlocks field.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84056 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 23:36:36 +00:00
Devang Patel
1619dc3b9e s/DebugLoc.CompileUnit/DebugLoc.Scope/g
s/DebugLoc.InlinedLoc/DebugLoc.InlinedAtLoc/g



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84054 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 23:28:53 +00:00
Douglas Gregor
404aa26b26 Add is_same type trait
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84029 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 21:17:00 +00:00