Commit Graph

13919 Commits

Author SHA1 Message Date
Andrew Trick
40f16cf91d Fix a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128912 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-05 19:13:11 +00:00
Andrew Trick
ce96902d88 Added *hidden* flags -print-options and -print-all-options so
developers can see if their driver changed any cl::Option's. The
current implementation isn't perfect but handles most kinds of
options. This is nice to have when decomposing the stages of
compilation and moving between different drivers. It's also a good
sanity check when comparing results produced by different command line
invocations that are expected to produce the comparable results.

Note: This is not an attempt to prolong the life of cl::Option. On the
contrary, it's a placeholder for a feature that must exist when
cl::Option is replaced by a more appropriate framework. A new
framework needs: a central option registry, dynamic name lookup,
non-global containers of option values (e.g. per-module,
per-function), *and* the ability to print options values and their defaults at
any point during compilation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128910 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-05 18:54:36 +00:00
Jakob Stoklund Olesen
a2948ef5ac Use std::unique instead of a SmallPtrSet to ensure unique instructions in UseSlots.
This allows us to always keep the smaller slot for an instruction which is what
we want when a register has early clobber defines.

Drop the UsingInstrs set and the UsingBlocks map. They are no longer needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128886 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-05 15:18:18 +00:00
Jakob Stoklund Olesen
1a7744501a Cache the fairly expensive last split point computation and provide a fast
inlined path for the common case.

Most basic blocks don't contain a call that may throw, so the last split point
os simply the first terminator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128874 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-05 04:20:27 +00:00
Bill Wendling
f05b1dcf87 Revamp the SjLj "dispatch setup" intrinsic.
It needed to be moved closer to the setjmp statement, because the code directly
after the setjmp needs to know about values that are on the stack. Also, the
'bitcast' of the function context was causing a dead load. This wouldn't be too
horrible, except that at -O0 it wasn't optimized out, and because it wasn't
using the correct base pointer (if there is a VLA), it would try to access a
value from a garbage address.
<rdar://problem/9130540>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128873 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-05 01:37:43 +00:00
Jim Grosbach
fcbe5b7193 Layer the memory manager between the JIT and the runtime Dyld.
The JITMemory manager references LLVM IR constructs directly, while the
runtime Dyld works at a lower level and can handle objects which may not
originate from LLVM IR. Introduce a new layer for the memory manager to
handle the interface between them. For the MCJIT, this layer will be almost
entirely simply a call-through w/ translation between the IR objects and
symbol names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128851 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-04 23:04:39 +00:00
Jakob Stoklund Olesen
6c8afd728e Stop caching basic block index ranges now that SlotIndexes can keep up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128821 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-04 15:32:15 +00:00
Tobias Grosser
cc5d992bc1 Region: Allow user control the printing style of the print function.
Contributed by: etherzhhb@gmail.com

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128808 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-04 07:19:18 +00:00
Peter Collingbourne
10fdd5a0f6 IntrusiveRefCntPtr: in RefCountedBase and RefCountedBaseVPTR, make
ref_cnt mutable and Retain/Release const to enable reference counted
pointers to const objects

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128804 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-04 00:57:03 +00:00
Eric Christopher
592cf78f84 Start migrating mach-o dumping facilities to the object file out of a
separate executable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128801 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-03 23:51:47 +00:00
Eric Christopher
e243fd9e2b Add a set of C bindings for the Object interface.
Patch by Patrick Walton!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128798 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-03 22:34:07 +00:00
Frits van Bommel
c12d4c93f9 Remove the LLVMContext& arguments from *Folder constructors, as they don't seem to be used anywhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128793 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-03 19:46:28 +00:00
Eli Friedman
71ad2c9eda PR9446: RecursivelyDeleteTriviallyDeadInstructions can delete the instruction
after the given instruction; make sure to handle that case correctly.
(It's difficult to trigger; the included testcase involves a dead 
block, but I don't think that's a requirement.) 

While I'm here, get rid of the unnecessary warning about
SimplifyInstructionsInBlock, since it should work correctly as far as I know.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128782 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-02 22:45:17 +00:00
Jakob Stoklund Olesen
5907d86365 Add an InterferenceCache class for caching per-block interference ranges.
When the greedy register allocator is splitting multiple global live ranges, it
tends to look at the same interference data many times. The InterferenceCache
class caches queries for unaltered LiveIntervalUnions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128764 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-02 06:03:35 +00:00
Jakob Stoklund Olesen
a122eaaee2 Use basic block numbers as indexes when mapping slot index ranges.
This is more compact and faster than using DenseMap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128763 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-02 06:03:31 +00:00
Cameron Zwarich
ed3caf9086 Add a RemoveFromWorklist method to DCI. This is needed to do some complicated
transformations in target-specific DAG combines without causing DAGCombiner to
delete the same node twice. If you know of a better way to avoid this (see my
next patch for an example), please let me know.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128758 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-02 02:40:26 +00:00
Jay Foad
8891ed7ac9 Various Instructions' resizeOperands() methods are only used to grow the
list of operands. Simplify and rename them accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128708 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-01 08:00:58 +00:00
Evan Cheng
8e23e815ad Issue libcalls __udivmod*i4 / __divmod*i4 for div / rem pairs.
rdar://8911343


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128696 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-01 00:42:02 +00:00
Richard Osborne
e8f3533323 Add XCore intrinsics for initializing / starting / synchronizing threads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128633 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-31 15:13:13 +00:00
Michael J. Spencer
56584fcbfd Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128631 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-31 13:06:39 +00:00
Michael J. Spencer
c9c08fb3a7 Switch FileRemover from PathV1 to V2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128630 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-31 13:04:19 +00:00
Jim Grosbach
f5b23368d2 Tidy up. Whitespace and 80-columns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128583 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 22:38:13 +00:00
Jakob Stoklund Olesen
b516e00b43 Don't add the same analysis implementation pair twice.
Prevent infinite growth of the list.

Patch by José Fonseca!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128568 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 18:32:53 +00:00
Jakob Stoklund Olesen
03ef449917 Reset StringMap's NumTombstones on clears and rehashes.
StringMap was not properly updating NumTombstones after a clear or rehash.

This was not fatal until now because the table was growing faster than
NumTombstones could, but with the previous change of preventing infinite
growth of the table the invariant (NumItems + NumTombstones <= NumBuckets)
stopped being observed, causing infinite loops in certain situations.

Patch by José Fonseca!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128567 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 18:32:51 +00:00
Jakob Stoklund Olesen
e10fff6f88 Prevent infinite growth of SmallPtrSet instances.
Rehash but don't grow when full of tombstones.

Patch by José Fonseca!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128566 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 18:32:48 +00:00
Jakob Stoklund Olesen
aea4fe2862 Prevent infinite growth of SmallMap instances.
Rehash but don't grow when full of tombstones.

Patch by José Fonseca!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128565 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 18:32:44 +00:00
Jakob Stoklund Olesen
414fdbdb01 Prevent infinite growth of the DenseMap.
When the hash function uses object pointers all free entries eventually
become tombstones as they are used at least once, regardless of the size.

DenseMap cannot function with zero empty keys, so it double size to get
get ridof the tombstones.

However DenseMap never shrinks automatically unless it is cleared, so
the net result is that certain tables grow infinitely.

The solution is to make a fresh copy of the table without tombstones
instead of doubling size, by simply calling grow with the current size.

Patch by José Fonseca!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128564 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 18:32:41 +00:00
Benjamin Kramer
2746000f4f Add APFloat::getExactInverse.
The idea is, that if an ieee 754 float is divided by a power of two, we can
turn the division into a cheaper multiplication. This function sees if we can
get an exact multiplicative inverse for a divisor and returns it if possible.

This is the hard part of PR9587.

I tested many inputs against llvm-gcc's frotend implementation of this
optimization and didn't find any difference. However, floating point is the
land of weird edge cases, so any review would be appreciated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128545 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 15:42:27 +00:00
Jay Foad
d01f2633b9 Fix more zero length memset warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128543 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 15:31:02 +00:00
Jay Foad
4499176789 Add a comment on PHINode::Create().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128540 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 13:29:06 +00:00
Jay Foad
3ecfc861b4 Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
PHINode::Create() giving the (known or expected) number of operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128537 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 11:28:46 +00:00
Bob Wilson
8be7d8b43c Revert a minor comment change inadvertently included with r128502.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128526 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 05:26:51 +00:00
Evan Cheng
92e3916c3b Add intrinsics @llvm.arm.neon.vmulls and @llvm.arm.neon.vmullu.* back. Frontends
was lowering them to sext / uxt + mul instructions. Unfortunately the
optimization passes may hoist the extensions out of the loop and separate them.
When that happens, the long multiplication instructions can be broken into
several scalar instructions, causing significant performance issue.

Note the vmla and vmls intrinsics are not added back. Frontend will codegen them
as intrinsics vmull* + add / sub. Also note the isel optimizations for catching
mul + sext / zext are not changed either.

First part of rdar://8832507, rdar://9203134


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128502 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-29 23:06:19 +00:00
Jim Grosbach
5acfa9f0fd Instantiate a JITMemoryManager for MCJIT Dyld
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128485 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-29 21:03:05 +00:00
Daniel Dunbar
8470475d6b C-API: Include DataTypes.h instead of stdint.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128446 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-29 02:30:34 +00:00
Daniel Dunbar
a7b8c2b6a4 Integrated-As: Add support for setting the AllowTemporaryLabels flag via
integrated-as.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128431 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-28 22:49:19 +00:00
Daniel Dunbar
c6cf43d258 MC: Add support for disabling "temporary label" behavior. Useful for debugging
on Darwin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128430 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-28 22:49:15 +00:00
Kevin Enderby
93f7936435 Again adding a C API to the disassembler for use by such tools as Darwin's
otool(1), this time with the needed fix for case sensitive file systems :) .
This is a work in progress as the interface for producing symbolic operands is
not done.  But a hacked prototype using information from the object file's
relocation entiries and replacing immediate operands with MCExpr's has been
shown to work with no changes to the instrucion printer.  These APIs will be
moved into a dynamic library at some point.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128415 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-28 18:25:07 +00:00
Frits van Bommel
6208610fd6 Constant folding support for calls to umul.with.overflow(), basically identical to the smul.with.overflow() code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128379 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-27 14:26:13 +00:00
Jakob Stoklund Olesen
adb877d62e Collect and coalesce DBG_VALUE instructions before emitting the function.
Correctly terminate the range of register DBG_VALUEs when the register is
clobbered or when the basic block ends.

The code is now ready to deal with variables that are sometimes in a register
and sometimes on the stack. We just need to teach emitDebugLoc to say 'stack
slot'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128327 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-26 02:19:36 +00:00
Kevin Enderby
17cbaa3c82 Remove the files for r128308 as it is causing a buildbot failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128309 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-26 00:23:05 +00:00
Kevin Enderby
12b04be85d Adding a C API to the disassembler for use by such tools as Darwin's otool(1).
This is a work in progress as the interface for producing symbolic operands is
not done.  But a hacked prototype using information from the object file's
relocation entiries and replacing immediate operands with MCExpr's has been
shown to work with no changes to the instrucion printer.  These APIs will be
moved into a dynamic library at some point.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128308 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-26 00:06:33 +00:00
Jim Grosbach
d31d304f83 Clean up assembly statement separator support.
The MC asm lexer wasn't honoring a non-default (anything but ';') statement
separator. Fix that, and generalize a bit to support multi-character
statement separators.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128227 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-24 18:46:34 +00:00
Jay Foad
0d4b81519d Fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128216 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-24 16:18:19 +00:00
Evan Cheng
acdddfedd1 Add comment to clarify what MachineConstantPoolEntry::isMachineConstantPoolEntry() means.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128204 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-24 06:28:45 +00:00
Jim Grosbach
b9b1e307f2 Fix comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128182 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-23 23:32:48 +00:00
Rafael Espindola
6421a8815e Add a lto_codegen_compile_to_file to avoid producing a file, reading it to
memory and writing it back to disk.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128108 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 20:57:13 +00:00
Rafael Espindola
11d1803770 We don't need a null terminator for the output file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128098 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 19:20:47 +00:00
Jim Grosbach
b3eecaf19e Propogate the error message, not just the error state.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128094 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 18:19:42 +00:00
Ted Kremenek
3311d951e2 Properly initialize all fields in CrashReporterCleanupContext. This caused the buildbot failure earlier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128071 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 04:33:13 +00:00