Commit Graph

11833 Commits

Author SHA1 Message Date
Chris Lattner
dd0fbda3e3 include densemap.h explicitly and rearrange #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100216 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 20:20:04 +00:00
Chris Lattner
de4845c163 Switch the code generator (except the JIT) onto the new DebugLoc
representation.  This eliminates the 'DILocation' MDNodes for 
file/line/col tuples from -O0 -g codegen.

This remove the old DebugLoc class, making it a typedef for DebugLoc,
I'll rename NewDebugLoc next.

I didn't update the JIT to use the new apis, so it will continue to
work, but be as slow as before.  Someone should eventually do this
or, better yet, rip out the JIT debug info stuff and build the JIT
on top of MC.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100209 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 19:42:39 +00:00
Evan Cheng
f28f8bc40e Correctly lower memset / memcpy of undef. It should be a nop. PR6767.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100208 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 19:36:14 +00:00
Evan Cheng
cf5862d8ac Revert 100204. It broke a bunch of tests and apparently changed what passes are run during codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100207 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 19:29:15 +00:00
David Greene
434bd8551d Let's try this again. Re-apply 100143 including an apparent missing
<string> include.  For some reason the buildbot choked on this while my
builds did not.  It's probably due to a difference in system headers.

---

Add some switches helpful for debugging:

-print-before=<Pass Name>

Dump IR before running pass <Pass Name>.

-print-before-all

Dump IR before running each pass.

-print-after-all

Dump IR after running each pass.

These are helpful when tracking down a miscompilation.  It is easy to
get IR dumps and do diffs on them, etc.

To make this work well, add a new getPrinterPass API to Pass so that
each kind of pass (ModulePass, FunctionPass, etc.) can create a Pass
suitable for dumping out the kind of object the Pass works on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100204 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 18:46:26 +00:00
Mon P Wang
e754d3fb85 Revert r100191 since it breaks objc in clang
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100199 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 18:43:02 +00:00
Mon P Wang
e33c848fa4 Reapply address space patch after fixing an issue in MemCopyOptimizer.
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100191 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 18:04:15 +00:00
Dan Gohman
a6194b3a2a Add an explicit keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100187 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 14:57:49 +00:00
Torok Edwin
86bfd34ece Fix SpecificBumpPtrAllocator iteration.
Need to start from (char*)(Slab+1), and not from (char*)Slab+1.
This fixes crashes in Win64 debug mode.
Thanks to Nicolas Capens!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100184 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 13:20:51 +00:00
Bob Wilson
6f69035970 Rewrite another SSAUpdater function to avoid recursion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100147 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 23:05:58 +00:00
Eric Christopher
1d8f83d0a0 Revert r100143.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100146 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 22:54:42 +00:00
David Greene
8ef3acba00 Add some switches helpful for debugging:
-print-before=<Pass Name>

Dump IR before running pass <Pass Name>.

-print-before-all

Dump IR before running each pass.

-print-after-all

Dump IR after running each pass.

These are helpful when tracking down a miscompilation.  It is easy to
get IR dumps and do diffs on them, etc.

To make this work well, add a new getPrinterPass API to Pass so that
each kind of pass (ModulePass, FunctionPass, etc.) can create a Pass
suitable for dumping out the kind of object the Pass works on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100143 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 22:43:57 +00:00
Evan Cheng
42642d06c9 Add comments about DstAlign and SrcAlign.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100132 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 20:10:42 +00:00
Bob Wilson
33f22e8c66 Change another SSAUpdater function to avoid recursion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100131 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 20:04:30 +00:00
Bob Wilson
e8b64281ce The SSAUpdater should avoid recursive traversals of the CFG, since that may
blow out the stack for really big functions.  Start by fixing an easy case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100126 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 18:46:59 +00:00
Evan Cheng
94107ba9ce - Avoid using floating point stores to implement memset unless the value is zero.
- Do not try to infer GV alignment unless its type is sized. It's not possible to infer alignment if it has opaque type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100118 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 18:19:11 +00:00
Gabor Greif
c8b82ccbcf Introduce ImmutableCallSite, useful for contexts where no mutation
is necessary. Inherits from new templated baseclass CallSiteBase<>
which is highly customizable. Base CallSite on it too, in a configuration
that allows full mutation.
Adapt some call sites in analyses to employ ImmutableCallSite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100100 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 08:21:08 +00:00
Chris Lattner
a41b9153c3 switch IRBuilder to use NewDebugLoc for locations instead
of raw mdnodes.  This allows frontends to specify debug
locations without ever creating an MDNode for the DILocation.

This requires a corresponding clang/llvm-gcc change which
I'll try to commit as simultaneously as possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100095 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 06:31:45 +00:00
Chris Lattner
f0100ff3f6 add comments, don't require inlined-at to be specified.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100092 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 06:29:56 +00:00
Evan Cheng
255f20f7f7 Fix sdisel memcpy, memset, memmove lowering:
1. Makes it possible to lower with floating point loads and stores.
2. Avoid unaligned loads / stores unless it's fast.
3. Fix some memcpy lowering logic bug related to when to optimize a
   load from constant string into a constant.
4. Adjust x86 memcpy lowering threshold to make it more sane.
5. Fix x86 target hook so it uses vector and floating point memory
   ops more effectively.
rdar://7774704


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100090 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 06:04:33 +00:00
Chris Lattner
61336ae001 Switch the representation of the location in instruction from
being a TrackingVH<MDNode> to a NewDebugLoc, shrinking 
sizeof(Instruction) a lot, and providing clients the ability
to deal with locations in terms of NewDebugLoc instead of
having to deal with Metadata.  This is still fully compatible
with all clients that *do* use MDNodes for everything of
course.

No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100088 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 05:23:13 +00:00
Chris Lattner
68c5513499 add a method to decode a DILocation into a NewDebugLoc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100081 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 03:55:42 +00:00
Eric Christopher
ec306a9771 Add aeskeygenassist intrinsic and rename all of the aes intrinsics to
aes instead of sse4.2.  Add a brief todo for a subtarget flag and rework
the aeskeygenassist instruction to more closely match the docs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100078 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 03:05:45 +00:00
Chris Lattner
b227925fa3 Add a new "NewDebugLoc" class which will eventually replace DebugLoc,
and will replace the 'DbgInfo' member in Instruction.

The benefit of NewDebugLoc is that it is compact (8 bytes vs 12/24 
bytes for the DbgInfo member in Instruction on a 32/64 bit system),
it means that we will end up not having to allocate MDNodes to 
represent the "DILocations" in common cases of -O0 -g, and it is
much more efficient to get things out of than the MDNode.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100072 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 00:37:44 +00:00
Bob Wilson
a0c6057061 Rewrite part of the SSAUpdater to be more careful about inserting redundant
PHIs.  The previous algorithm was unable to reliably detect when existing
PHIs in a cycle can be reused.  I'm still working on reducing a testcase.
Radar 7711900.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100047 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 20:51:00 +00:00
Duncan Sands
6417a6c99d Correct comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99991 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 05:27:33 +00:00
Chris Lattner
b6c72b92c2 fix file header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99987 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 04:26:23 +00:00
Chris Lattner
5169c9e567 make irbuilder use the new optimized debug info accessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99984 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 04:09:11 +00:00
Chris Lattner
870cfcf9a6 add new apis for getting/setting !dbg metadata on
instructions.  In addition to being a convenience,
they are faster than the old apis, particularly when
not going from an MDKindID like people should be
doing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99982 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 03:34:40 +00:00
Chris Lattner
ec39f095f5 Fix a major source of compile-time slowness at -O0 -g by optimizing
the storage of !dbg metadata kinds in the instruction themselves.
The on-the-side hash table works great for metadata that not-all
instructions get, or for metadata that only exists when optimizing.
But when compile-time is everything, it isn't great.

I'm not super thrilled with the fact that this plops a TrackingVH in
Instruction, because it grows it by 3 words.  I'm investigating 
alternatives, but this should be a step in the right direction in any
case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99957 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 23:03:27 +00:00
Bob Wilson
100f090add Revert Mon Ping's change 99928, since it broke all the llvm-gcc buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99948 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 22:27:04 +00:00
Mon P Wang
808bab0169 Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
A update of langref will occur in a subsequent checkin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99928 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 20:55:56 +00:00
Benjamin Kramer
991de14dd6 Introduce SpecificBumpPtrAllocator, a wrapper for BumpPtrAllocator which allows
only a single type of object to be allocated. Use it to make VNInfo destruction
typesafe.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99919 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 20:16:45 +00:00
Dan Gohman
132a9946bf Fix llvm-ld to clean up its output files in case of an error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99915 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 19:56:41 +00:00
Eric Christopher
8258d0b4bf Remove the pmulld intrinsic and autoupdate it as a vector multiply.
Rewrite the pmulld patterns, and make sure that they fold in loads of
arguments into the instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99910 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 18:49:01 +00:00
Chris Lattner
9b97a73ded Rip out the 'is temporary' nonsense from the MCContext interface to
create symbols.  It is extremely error prone and a source of a lot
of the remaining integrated assembler bugs on x86-64.

This fixes rdar://7807601.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99902 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 18:10:53 +00:00
Douglas Gregor
0179e97723 Switch isa_impl from a function template to a class template with a
static inline member function doit(). This enables the use of partial
specialization to override the last stage of the "isa" check.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99898 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 18:05:52 +00:00
Douglas Gregor
6ce57922bb Introduce namespace-scope functions to enable LLVM statistics without
passing the command-line parameter "-stats" and to print the resulting
statistics without calling llvm_shutdown().



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99893 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 17:32:08 +00:00
Ted Kremenek
8260ea5c6c Change PointerUnionX::getFromOpaqueValue() to be declared 'static inline' instead of 'static'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99892 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 16:20:03 +00:00
Torok Edwin
01cb1b665d Reapply r99881 with some fixes: only call destructor in releaseMemory!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99883 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 11:17:48 +00:00
Torok Edwin
226dd2ba99 Revert 99881, it brooke smooshlab's llvm-gcc-i386-darwin9.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99882 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 10:25:08 +00:00
Torok Edwin
2a22004f68 Introduce another Reset() method in BumpPtrAllocator that calls a destructor
on all objects it has allocated, if they are all of the same size and alignment.
Use this to destruct all VNInfos allocated in LiveIntervalAnalysis (PR6653).

valnos is not reliable for this purpose, as seen in r99400
(which still leaked, and sometimes caused double frees).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99881 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 10:08:26 +00:00
Chris Lattner
cebf5bc2ee stringref'ize Timer apis
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99877 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 05:34:02 +00:00
Chris Lattner
83fa78efb1 finally, maintain a global list of timer groups, allowing us to
implement TimerGroup::printAll, which prints and resets all active
timers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99876 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 05:27:58 +00:00
Chris Lattner
ecdbff8c74 add a new TimerGroup::print method, and refactor away the bogus
TimerGroup copy ctor and assignment operator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99875 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 05:20:02 +00:00
Chris Lattner
9f9f6d19dd if a timergroup is destroyed before its timers, print times.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99873 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 04:58:26 +00:00
Chris Lattner
b9312690a2 change TimerGroup to keep a linked list of active timers
instead of just a count of them, and refactor the guts of
report printing out of removeTimer into its own method.
Refactor addTimerToPrint away.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99872 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 04:40:01 +00:00
Chris Lattner
a782e75d48 reapply my timer rewrite with a change for PassManager to store
timers by pointer instead of by-value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99871 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 04:03:22 +00:00
Chris Lattner
0d2725ad69 revert r99862 which is causing FNT failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99870 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 03:57:00 +00:00
Chris Lattner
9fa0eff30a fairly major rewrite of various timing related stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99862 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 02:38:19 +00:00
Chris Lattner
fc86c3cfd6 remove support for per-time peak memory tracking, this
isn't used by anyone and is better exposed as a non-per-timer 
thing.  Also, stop including System/Mutex.h in Timer.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99841 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 21:28:41 +00:00
Chris Lattner
0ea86bc411 various timer fixes: move operator= out of line,
eliminate the per-timer lock (timers should be 
externally locked if needed), the info-output-stream
can never be dbgs(), so drop the check.  Make some
stuff private.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99839 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 21:24:52 +00:00
Benjamin Kramer
34247a0f35 Make isInt?? and isUint?? template specializations of the generic versions. This
makes calls a little bit more consistent and allows easy removal of the
specializations in the future. Convert all callers to the templated functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99838 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 21:13:41 +00:00
Evan Cheng
31441b7e95 Pool allocate SDDbgValue nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99836 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 20:48:30 +00:00
Devang Patel
553881bddc Refactor code to push DILocation prcessing into DwarfDebug.cpp from AsmPrinter.cpp.
This is same as r99772 (which was reverted) with just one meaningful difference where two source lines exchanged their positions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99816 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 17:20:31 +00:00
Devang Patel
de9b1efbe5 Revert 99772.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99778 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 21:23:37 +00:00
Devang Patel
c7eae5ca4a Refactoring. Push DILocation processing in to DwarfDebug from AsmPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99772 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 18:57:09 +00:00
Torok Edwin
b4bc96317a Fix use-of-uninitialized value when RWX memory can't be allocated (PR6701).
SELinux doesn't allow 'execmem', returning MAP_FAILED and 'Permission denied'
for mmap or RWX memory. In this case AllocateRWX was returning a MemoryBlock
with uninitialized fields, which sometimes caused crashes.

This patch initializes MemoryBlock fields to 0, so that the RWX-failure check
works.
It doesn't fix the SELinux 'execmem' issues though (the JIT will not work when
SELinux is in enforcing mode).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99762 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 11:07:36 +00:00
Chris Lattner
caa8870fe0 finally remove the immAllOnesV_bc/immAllZerosV_bc patterns
and those derived from them.  These are obnoxious because
they were written as: PatLeaf<(bitconvert).  Not having an
argument was foiling adding better type checking for operand
count matching up with what was required (in this case,
bitconvert always requires an operand!)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99759 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 08:43:23 +00:00
Chris Lattner
e7700999b8 add some node definitions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99745 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 06:16:41 +00:00
Chris Lattner
aa4e3391c8 add an optimized form of OPC_EmitMergeInputChains for the 1, 0 and
1, 1 cases which are by-far the most frequent.  This shrinks the X86
isel table from 77014 -> 74657 bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99740 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 05:50:16 +00:00
Dan Gohman
a5d0501b59 Give FileRemover a default constructor to allow FileRemovers to be created
and initialized separately.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99717 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 16:39:56 +00:00
Dan Gohman
60a6e1f461 Add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99715 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 16:34:32 +00:00
Chris Lattner
310adf1c6f remove parallel support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99703 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 02:53:27 +00:00
Chris Lattner
f2ddf15dc7 bump FIRST_TARGET_MEMORY_OPCODE back up, there is no reason to make it a tight bound anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99685 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 00:29:41 +00:00
Anton Korobeynikov
de0118c324 Add few missed libcalls and correct names for others.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99656 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-26 21:32:14 +00:00
Dan Gohman
a7a33fd95f Fix SmallVector's insert to handle non-random-access iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99633 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-26 18:53:37 +00:00
Gabor Greif
44424646ac rename pred_const_iterator to const_pred_iterator for consistency's sake
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99567 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 23:25:28 +00:00
Gabor Greif
60ad781c61 rename use_const_iterator to const_use_iterator for consistency's sake
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99564 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 23:06:16 +00:00
Daniel Dunbar
ac2884a717 llvm-mc: Add a -mc-relax-all option, which relaxes every fixup. We always need
exactly two passes in that case, and don't ever need to recompute any layout,
so this is a nice baseline for relaxation performance.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99563 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 22:49:09 +00:00
Daniel Dunbar
0cc8bd4861 MC: Stop restarting layout on every relaxation.
- Still O(N^2), just a faster form, and now its the MCAsmLayout's fault.

On the .s I am tuning against (combine.s from 403.gcc):
--
ddunbar@lordcrumb:MC$ diff stats-before.txt stats-after.txt
5,10c5,10
<    1728 assembler - Number of assembler layout and relaxation steps
<    7707 assembler - Number of emitted assembler fragments
<  120588 assembler - Number of emitted object file bytes
< 2233448 assembler - Number of evaluated fixups
<    1727 assembler - Number of relaxed instructions
< 6723845 mcexpr    - Number of MCExpr evaluations
---
>      3 assembler - Number of assembler layout and relaxation steps
>   7707 assembler - Number of emitted assembler fragments
> 120588 assembler - Number of emitted object file bytes
>  14796 assembler - Number of evaluated fixups
>   1727 assembler - Number of relaxed instructions
>  67889 mcexpr    - Number of MCExpr evaluations
--
Feel free to LOL at the -before numbers, if you like.

I am a little surprised we make more than 2 relaxation passes. It's pretty
trivial for us to do relaxation out-of-order if that would give a speedup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99543 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 19:35:56 +00:00
Daniel Dunbar
f476b00f51 MC: Simplify main section layout process by moving alignment into LayoutSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99529 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 18:16:42 +00:00
Daniel Dunbar
be644a38c0 MC: Sink Section address assignment into LayoutSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99528 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 18:16:38 +00:00
Bob Wilson
86afec7730 Reapply Kevin's change 94440, now that Chris has fixed the limitation on
opcode values fitting in one byte (svn r99494).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99514 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 16:36:14 +00:00
Daniel Dunbar
5a6e97a7e4 MC: Explicity track section and fragment ordinals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99500 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 07:10:11 +00:00
Devang Patel
d4c6c3a7c3 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99493 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 06:26:14 +00:00
Eric Christopher
f27e6088a3 Reapply r99451 with a fix to move the NoInline check to the cost functions
instead of InlineFunction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99483 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 04:49:10 +00:00
Daniel Dunbar
5d428511ca MC: Route access to SectionData offset and file size through MCAsmLayout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99474 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 02:00:07 +00:00
Daniel Dunbar
432cd5fd9b MC: Route access to Fragment offset and effective size through MCAsmLayout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99473 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 02:00:02 +00:00
Evan Cheng
bfcb305189 Change how dbg_value sdnodes are converted into machine instructions. Their placement should be determined by the relative order of incoming llvm instructions. The scheduler will now use the SDNode ordering information to determine where to insert them. A dbg_value instruction is inserted after the instruction with the last highest source order and before the instruction with the next highest source order. It will optimize the placement by inserting right after the instruction that produces the value if they have consecutive order numbers.
Here is a theoretical example that illustrates why the placement is important.

tmp1 = 
store tmp1 -> x
...
tmp2 = add ...
...
call
...
store tmp2 -> x

Now mem2reg comes along:

tmp1 = 
dbg_value (tmp1 -> x)
...
tmp2 = add ...
...
call
...
dbg_value (tmp2 -> x)

When the debugger examine the value of x after the add instruction but before the call, it should have the value of tmp1.

Furthermore, for dbg_value's that reference constants, they should not be emitted at the beginning of the block (since they do not have "producers").

This patch also cleans up how SDISel manages DbgValue nodes. It allow a SDNode to be referenced by multiple SDDbgValue nodes. When a SDNode is deleted, it uses the information to find the SDDbgValues and invalidate them. They are not deleted until the corresponding SelectionDAG is destroyed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99469 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 01:38:16 +00:00
Daniel Dunbar
7c3d45a03e MC: Eliminate MC{Fragment,{Section,Symbol}Data}::getAddress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99467 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 01:03:24 +00:00
Eric Christopher
1f2ae40efd Fix unused parameter warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99463 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 00:59:51 +00:00
Dan Gohman
6a4824c466 Docuemntation corrections from John Myers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99454 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 00:03:04 +00:00
Eric Christopher
0623e90398 Temporarily revert this, it's causing an issue with an internal project.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99451 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 23:35:21 +00:00
Bob Wilson
014dc4e720 Speculatively revert this to see if it fixes buildbot failures.
--- Reverse-merging r99440 into '.':
U    test/MC/AsmParser/X86/x86_32-bit_cat.s
U    test/MC/AsmParser/X86/x86_32-encoding.s
U    include/llvm/IntrinsicsX86.td
U    include/llvm/CodeGen/SelectionDAGNodes.h
U    lib/Target/X86/X86InstrSSE.td
U    lib/Target/X86/X86ISelLowering.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99450 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 23:26:29 +00:00
Chris Lattner
375cf52638 add a convenient TargetInstrDesc::getNumImplicitUses/Defs method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99446 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 23:07:47 +00:00
Kevin Enderby
760c2f34d9 Added the Advanced Encryption Standard (AES) Instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99440 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 22:33:33 +00:00
Devang Patel
8fe7979c41 Do not rely on getCompileUnit() to find source file information for a subprogram.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99410 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 18:48:00 +00:00
Gabor Greif
c9f7500d17 Finally land the InvokeInst operand reordering.
I have audited all getOperandNo calls now, fixing
hidden assumptions. CallSite related uglyness will
be eliminated successively.

Note this patch has a long and griveous history,
for all the back-and-forths have a look at
CallSite.h's log.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99399 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 13:21:49 +00:00
Daniel Dunbar
207e06ea04 MC: Direct all {fragment,section,symbol} address access through the MCAsmLayout object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99380 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 03:43:40 +00:00
Dan Gohman
0f920e55fc Remove the ConvertActions table and associated code, which is unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99372 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 00:53:38 +00:00
Chris Lattner
8ee0769612 Add a method to get a StringMapEntry from a pointer to the string
data it contains (similar to GetStringMapEntryFromValue).  
Patch by Greg Clayton!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99371 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 00:53:27 +00:00
Dan Gohman
92d7b35bd0 Fix coding style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99362 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 00:27:49 +00:00
Dan Gohman
66617633e7 Generalize findNearestCommonDominator to work on post-dominators,
based on a suggestion by Jochen Wilhelmy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99361 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 00:22:24 +00:00
Chris Lattner
ae8f4c4f86 [llvm_void_ty] is no longer needed for result types,
just use an empty result list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99346 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 23:46:07 +00:00
Chris Lattner
a54934ae9d add some accessors to callsite/callinst/invokeinst to check
for the noinline attribute, and make the inliner refuse to
inline a call site when the call site is marked noinline even
if the callee isn't.  This fixes PR6682.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99341 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 22:59:07 +00:00
Dan Gohman
bc7a902713 Revert 99335. getTypeToExpandTo's iterative behavior is actually
needed here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99339 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 22:44:42 +00:00
Dan Gohman
349074896f Remove getTypeToExpandTo, since it isn't adding much value
beyond just calling getTypeToTransformTo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99335 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 22:15:31 +00:00
Evan Cheng
a56daf8a39 Add comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99284 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 15:50:49 +00:00
Evan Cheng
d826e65ef2 Forgot this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99283 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 15:49:37 +00:00
Daniel Dunbar
337055e62f MC: Add TargetAsmBackend::MayNeedRelaxation, for checking whether a particular instruction + fixups might need relaxation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99249 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 03:13:05 +00:00
Daniel Dunbar
8f9b80e5df MC: Add TargetAsmBackend::WriteNopData and use to eliminate some target dependencies in MCMachOStreamer and MCAssembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 02:36:58 +00:00
Daniel Dunbar
829680048c MC: Add TargetAsmBackend::RelaxInstruction callback, and custom X86 implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99245 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 01:39:09 +00:00
Daniel Dunbar
9799de910e MC: Tweak MCInstFragment to include the encoded data and fixups, so that we don't need to recompute them during relaxation. I will revisit this once all the other pieces of fast relaxation are in place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99244 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 01:39:05 +00:00
Jeffrey Yasskin
1ccd91a5b1 Put MCSectionCOFF::Name into the MCContext instead of leaking it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99231 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 23:26:12 +00:00
Daniel Dunbar
3f4dcd92da MC: Add MCInstFragment, not used yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99229 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 23:16:48 +00:00
Daniel Dunbar
9d39e616cc MC: Fix a few more cases we were passing an MCDataFragment when a MCFragment would do, and sprinkle in some const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99218 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 21:49:41 +00:00
Daniel Dunbar
67c076cf59 MCInst: Add ::dump_pretty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99216 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 21:49:34 +00:00
Daniel Dunbar
b751418a39 MC: Change MCObjectWriter::RecordRelocation to take an MCFragment (instead of a MCDataFragment). Object files should only need the generic MCFragment features.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99205 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 20:35:50 +00:00
Daniel Dunbar
2a6e3f5be2 MC: Eliminate MCFragment::getMaxFileSize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99203 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 20:35:43 +00:00
Daniel Dunbar
8d39eb47d6 MC: Share the MCAsmLayout object, although its still not used for anything important.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99202 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 20:35:35 +00:00
Gabor Greif
1cde4af157 backing out r99170 because it still fails on clang-x86_64-darwin10-fnt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99171 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 09:11:00 +00:00
Gabor Greif
9b1061e2e3 Now that hopefully all direct accesses to InvokeInst operands are fixed
we can reapply the InvokeInst operand reordering patch. (see r98957).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99170 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 08:28:00 +00:00
Jeffrey Yasskin
bf48a9b6db Memoize InlineAsms into the LLVMContext and delete them on shutdown.
Fixes PR803.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99143 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-21 20:37:19 +00:00
Daniel Dunbar
5d067fe158 TargetRegistry: Fix create{AsmInfo,MCDisassembler} to return non-const objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 22:36:22 +00:00
Gabor Greif
654c06f645 Add a setCalledFunction member to InvokeInst (like in CallInst)
and use this (as well as getCalledValue) to access the callee,
instead of {g|s}etOperand(0).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99084 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 21:00:25 +00:00
Dan Gohman
472fdf7090 Clear the SCEVExpander's insertion point after making deletions,
so that the SCEVExpander doesn't retain a dangling pointer as its
insert position. The dangling pointer in this case wasn't ever used
to insert new instructions, but it was causing trouble with
SCEVExpander's code for automatically advancing its insert position
past debug intrinsics.

This fixes use-after-free errors that valgrind noticed in
test/Transforms/IndVarSimplify/2007-06-06-DeleteDanglesPtr.ll and
test/Transforms/IndVarSimplify/exit_value_tests.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99036 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 03:53:53 +00:00
Dan Gohman
6c7ed6b549 Fix more places to more thoroughly ignore debug intrinsics. This fixes
use-before-def errors in SCEVExpander-produced code in sqlite3 when debug
info with optimization is enabled, though the testcases for this are
dependent on use-list order.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99001 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 21:51:03 +00:00
Kevin Enderby
b46b03b36f Fixed the encoding problems of the crc32 instructions. All had the Operand size
override prefix and only the r/m16 forms should have had that.  Also for variant
one, the AT&T syntax, added suffixes to all forms.  Also added the missing
64-bit form for 'CRC32 r64, r/m8'.  Plus added test cases for all forms and
tweaked one test case to add the needed suffixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98980 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 20:04:42 +00:00
Bob Wilson
80d23705e6 Stop trying to merge identical jump tables. This had been inadvertently
disabled for several months (since svn r88806) and no one noticed.  My fix
for pr6543 yesterday reenabled it, but broke the ARM port's code for using
TBB/TBH.  Rather than adding a target hook to disable merging for Thumb2 only,
I'm just taking this out.  It is not common to have identical jump tables,
the code we used to merge them was O(N^2), and it only helps code size, not
performance.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98977 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 19:05:41 +00:00
Douglas Gregor
d4d4a90a8c Acccess control is lame
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98962 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 15:36:58 +00:00
Douglas Gregor
1a07bc5cf4 struct -> class, to silence a Clang warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98961 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 15:31:09 +00:00
Gabor Greif
cc52ed0c4f back out r98957, it broke http://smooshlab.apple.com:8010/builders/clang-x86_64-darwin10-fnt/builds/703 in the nightly test suite
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98958 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 13:50:02 +00:00
Gabor Greif
f4f10e3779 Recommit r80858 again (which has been backed out in r80871).
This time I did a self-hosted bootstrap on Linux x86-64,
with no problems. Let's see how darwin 64-bit self-hosting
goes. At the first sign of failure I'll back this out.

Maybe the valgrind bots give me a hint of what may be wrong
(it at all).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98957 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 11:55:53 +00:00
Daniel Dunbar
1a9158c301 MC: Add TargetAsmBackend::createObjectWriter.
- MCAssembler is now object-file independent, although we will surely need more work to fully support ELF/COFF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98955 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 10:43:26 +00:00
Daniel Dunbar
b36052f0e4 MCCodeEmitter: Add target independent fixup flag for is-pc-relative.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98954 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 10:43:23 +00:00
Daniel Dunbar
cf871e5abf MC: Sink code emitter into MCAssembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98953 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 10:43:18 +00:00
Daniel Dunbar
2df4ceba15 MC/Mach-O: Move to MachObjectWriter.{h,cpp}.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98952 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 10:43:15 +00:00
Daniel Dunbar
cc5b84c6fb MC: Add TargetAsmBackend::isVirtualSection hook.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98950 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 09:29:03 +00:00
Daniel Dunbar
53b2338a1d MC: Split MCObjectWriter out of MCAssembler.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98949 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 09:28:59 +00:00
Daniel Dunbar
87190c473c MCAssembler: Move ApplyFixup to the TargetAsmBackend, this is a target specific not object writer specific task.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98947 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 09:28:12 +00:00
Daniel Dunbar
b1e98945e4 MC/Mach-O: Lift the fixup evaluation and application up (to the same place), and eliminate MCAsmFixup::FixedValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98944 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 07:09:47 +00:00
Daniel Dunbar
bacba99778 MC/Mach-O: Factor out ExecutePostLayoutBinding, to separate the post-layout changes the object writer may need to make to the assembler from the actual .o writing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98943 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 07:09:33 +00:00
Chris Lattner
4c42a6de9f fix an MCInstPrinter leak that jyasskin pointed out:
createAsmStreamer now takes ownership of the instprinter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98939 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 05:48:53 +00:00
Chris Lattner
e8cabf3c2e add a new SDNPVariadic SDNP node flag, and use it in
dag isel gen instead of instruction properties.  This
allows the oh-so-useful behavior of matching a variadic
non-root node.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98934 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 05:07:09 +00:00
Daniel Dunbar
8ad0dccbf2 MC/Mach-O/x86_64: Add getAtom[ForAddress].
- These find the defining symbol which identifies the containing atom for a symbol or address. They are currently very slow, but will be eliminated eventually.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98925 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 03:18:15 +00:00
Daniel Dunbar
2386985663 MC/Mach-O: Factor out isSymbolLinkerVisible method; "linker visible" is a made up term to refer to non-temporary labels + temporary labels in sections-which-require symbols. For Darwin, it corresponds to symbols which effectively define an atom.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98923 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 03:18:09 +00:00
Chris Lattner
09a2769a7f use ins/outs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98867 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 20:55:31 +00:00
Daniel Dunbar
8cc9c0c487 MC/AsmMatcher: Add support for target specific "instruction cleanup" functions,
to allow custom post-processing of matched instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98857 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 20:05:56 +00:00
Dan Gohman
debbef20ee offsetof always has type size_t.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98854 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 19:37:35 +00:00
Benjamin Kramer
d720712f67 Fix a name clash that was breaking MSVC builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98852 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 19:34:06 +00:00
Dan Gohman
aea1b501ce Explicitly cast std::min's arguments to avoid type mismatches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98851 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 19:01:12 +00:00
Dan Gohman
9553188fcc Define placement new wrappers for BumpPtrAllocator and
RecyclingAllocator to allow client code to be simpler, and
simplify several clients.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 18:49:47 +00:00
Bob Wilson
d1ec31dca5 Fix pr6543: svn r88806 changed MachineJumpTableInfo::getJumpTableIndex() to
always create a new jump table.  The intention was to avoid merging jump
tables in SelectionDAGBuilder, and to wait for the branch folding pass to
merge tables.  Unfortunately, the same getJumpTableIndex() method is also
used to merge tables in branch folding, so as a result of this change
branch tables are never merged.  Worse, the branch folding code is expecting
getJumpTableIndex to always return the index of an existing table, but with
this change, it never does so.  In at least some cases, e.g., pr6543, this
creates references to non-existent tables.

I've fixed the problem by adding a new createJumpTableIndex function, which
will always create a new table, and I've changed getJumpTableIndex to only
look at existing tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98845 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 18:42:41 +00:00
Dan Gohman
74cdc75313 Fix a bug found by inspection; in the __GNUC__ code, the alignment
doesn't apply to the type, only to the variable, so subsequent uses
of U which expect it to be aligned weren't actually aligned.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 18:40:47 +00:00
Andrew Lenharth
8bba4dd9bc Nick wants these alphabetized
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98840 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 18:18:00 +00:00
Dan Gohman
c93b4cff89 Add the ability to "intern" FoldingSetNodeID data into a
BumpPtrAllocator-allocated region to allow it to be stored in a more
compact form and to avoid the need for a non-trivial destructor call.

Use this new mechanism in ScalarEvolution instead of
FastFoldingSetNode to avoid leaking memory in the case where a
FoldingSetNodeID uses heap storage, and to reduce overall memory
usage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98829 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 16:16:38 +00:00
Dan Gohman
f9e64729af Reapply r98755 with a thinko which miscompiled gengtype fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98793 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 01:17:13 +00:00
Daniel Dunbar
9a1d20042f MCValue: Change to holding MCSymbolRefExprs instead of MCSymbols, we will need this for accessing to symbol modifiers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 00:59:10 +00:00
Daniel Dunbar
daf9733369 Add MCSymbol::isInSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98790 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 00:59:02 +00:00
Daniel Dunbar
0682951b4f MC/Darwin: Add a new target hook for whether the target uses "reliable" symbol differences, basically whether the assembler should attempt to understand atoms when using scattered symbols.
Also, avoid some virtual call overhead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98789 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 00:58:53 +00:00
Dan Gohman
ebf78f18df Revert 98755, which may be causing trouble.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98762 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 19:54:53 +00:00
Dan Gohman
0afc29c3e6 Change SCEVNAryExpr's operand array from a SmallVector to a plain
pointer and length, and allocate the arrays in ScalarEvolution's
BumpPtrAllocator, so that they get released when their owning
SCEV gets released. SCEVs are immutable, so they don't need to worry
about operand array resizing. This fixes a memory leak reported
in PR6637.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98755 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 18:51:01 +00:00
Bob Wilson
f9cf8b35bb Remove an unnecessary (and misspelled) typedef. Tweak whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98753 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 18:43:25 +00:00
Andrew Lenharth
7e1b037edd missing include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98752 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 18:33:00 +00:00
Chris Lattner
77e7694026 fix GetOrCreateTemporarySymbol to require a name, clients
should use CreateTempSymbol() if they don't care about the
name.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98712 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 05:41:18 +00:00
Chris Lattner
b095ba439d remove dead variable, patch by Nathan Howell!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98704 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 01:45:17 +00:00
Chris Lattner
730f743c01 work around an MSVC2010 bug, PR6504
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98653 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 19:07:05 +00:00
Gabor Greif
138acfe353 fix PR6589
adjusted unittest

I have added some doxygen to OptionalOperandTraits,
so hopefully there will be no confusion in the future.

Incidentally OptionalOperandTraits is not used any more (IIUC),
but the obvious client would be BranchInstr, and I plan
to rearrange it that way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98624 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 10:59:48 +00:00
Chris Lattner
999aee24c7 Fix the third (and last known) case of code update problems due
to LLVM IR changes with addr label weirdness.  In the testcase, we
generate references to the two bb's when codegen'ing the first
function:

_test1:                                 ## @test1
	leaq	Ltmp0(%rip), %rax
..
	leaq	Ltmp1(%rip), %rax

Then continue to codegen the second function where the blocks
get merged.  We're now smart enough to emit both labels, producing
this code:

_test_fun:                              ## @test_fun
## BB#0:                                ## %entry
Ltmp1:                                  ## Block address taken
Ltmp0:
## BB#1:                                ## %ret
	movl	$-1, %eax
	ret

Rejoice.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98595 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 00:29:39 +00:00
Daniel Dunbar
4e815f8a8c MC: Allow modifiers in MCSymbolRefExpr, and eliminate X86MCTargetExpr.
- Although it would be nice to allow this decoupling, the assembler needs to be able to reason about MCSymbolRefExprs in too many places to make this viable. We can use a target specific encoding of the variant if this becomes an issue.
 - This patch also extends llvm-mc to support parsing of the modifiers, as opposed to lumping them in with the symbol.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98592 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 23:51:06 +00:00
Daniel Dunbar
d6e59084d0 MC/Mach-O/x86_64: Temporary labels in cstring sections require symbols (and external relocations, but we don't have x86_64 relocations yet).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98583 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 21:56:50 +00:00
Daniel Dunbar
99d22adcad MC/Mach-O: Add MCSectionMachO::getType()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98582 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 21:56:38 +00:00
Chris Lattner
9cc0da9c29 Implement support for the case when a reference to a addr-of-bb
label is generated, but then the block is deleted.  Since the
value is undefined, we just emit the label right after the entry 
label of the function.  It might matter that the label is in the
same section as the function was afterall.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98579 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 20:39:00 +00:00
Douglas Gregor
1bb30b6f75 Extend MemoryBuffer::getFile() to take an optional "stat" structure
pointer. If given, the structure will be set with the stat information from
the file actually read.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98575 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 20:32:14 +00:00
Chris Lattner
0220ba7995 Fix the case when a reference to an address taken BB is emitted in one
function, then the BB is RAUW'd before the definition is emitted.  There
are still two cases not being handled, but this should improve us back to
the situation before I touched anything.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98566 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 19:09:43 +00:00
Jeffrey Yasskin
ad181304e1 Don't save a temporary string into a StringRef field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98538 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 06:59:21 +00:00
Chris Lattner
1f8008cf21 fix MCSectionELF to not leak memory, just like I did for MCSymbol.
MCSectionMachO is already fine (yay for fixed size arrays?),
MCSectionCOFF still leaks.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98537 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 06:23:52 +00:00
Chris Lattner
c28cc093e3 fix a memory leak yjasskin pointed out: MCSymbol is bump pointer
allocated and thus not freed.  This is cool except that it contains
and std::string so the string data didn't get freed.  In any case
there is no reason to redundantly store the string data in the 
MCSymbol anyway, just make the MCSymbol ref the string data in the
MCContext StringMap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98536 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 06:15:35 +00:00
Chris Lattner
6894b07996 MachineMove ctor doesn't need to to mutate input, add 'const'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98533 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 05:55:35 +00:00
Jeffrey Yasskin
f28411f732 Tell Valgrind when we modify already-executed machine code so it knows
to re-instrument the code.  We depend on the system valgrind.h to
avoid adding a new license.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98529 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 04:57:55 +00:00
Chris Lattner
a833f6b061 remove dead method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98526 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 00:00:42 +00:00
Duncan Sands
d2c817eff1 Turn calls to copysignl into an FCOPYSIGN node. Handle FCOPYSIGN nodes
with ppc_f128 type by having the type legalizer turn these back into a
call to copysignl.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98514 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 21:08:40 +00:00
Anton Korobeynikov
927411b7ce Make default expansion for FP16 <-> FP32 nodes into libcalls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98501 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 18:42:24 +00:00
Anton Korobeynikov
be5b032e4b Add DAG nodes to represent FP16 <-> FP32 intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98500 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 18:42:15 +00:00
Anton Korobeynikov
feacf28cf8 Cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98499 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 18:42:08 +00:00
Anton Korobeynikov
675043b19d The fp16 <-> fp32 intrinsics are pure, mark them so they can be CSE'd, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98498 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 18:42:04 +00:00
Anton Korobeynikov
676f968fec Add intrinsics to represent fp16 <-> fp32 conversions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98497 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 18:41:50 +00:00
Chris Lattner
3b9d6216a4 fix AsmPrinter::GetBlockAddressSymbol to always return a unique
label instead of trying to form one based on the BB name (which
causes collisions if the name is empty).  This fixes PR6608


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98495 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 17:53:23 +00:00
Chris Lattner
63d7836267 get MMI out of the label uniquing business, just go to MCContext
to get unique assembler temporary labels.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98489 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 08:36:50 +00:00
Chris Lattner
1d72a76616 add a new CreateTempSymbol method, the use case for
CreateTempSymbol vs GetOrCreateTemporarySymbol are
completely different.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98486 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 08:23:30 +00:00
Chris Lattner
2e9919a5e5 Now that DBG_LABEL is updated, we can finally make MachineMove
contain an MCSymbol instead of a label index.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98482 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 08:12:40 +00:00
Chris Lattner
aba9bcb9b6 switch GC_LABEL to use an MCSymbol operand instead of a label ID operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98474 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 07:27:07 +00:00
Chris Lattner
7561d48095 change the LabelSDNode to be EHLabelSDNode and make it hold
an MCSymbol.  Make the EH_LABEL MachineInstr hold its label
with an MCSymbol instead of ID.  Fix a bug in MMI.cpp which
would return labels named "Label4" instead of "label4".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98463 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 02:33:54 +00:00
Chris Lattner
18589de9b1 eliminate InvalidateLabel and LabelIDList from MMI and replace
them with a counter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98462 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 02:24:55 +00:00
Chris Lattner
b91306053d use Label->isDefined() instead of isLabelDeleted() now that we
consistently use MCSymbol and only call this predicate after
they should have been emitted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98461 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 02:20:58 +00:00
Chris Lattner
1611273351 change EH related stuff (other than EH_LABEL) to use MCSymbol
instead of label ID's.  This cleans up and regularizes a bunch 
of code and makes way for future progress.

Unfortunately, this pointed out to me that JITDwarfEmitter.cpp
is largely copy and paste from DwarfException/MachineModuleInfo
and other places.  This is very sad and disturbing. :(

One major change here is that TidyLandingPads moved from being
called in DwarfException::BeginFunction to being called in
DwarfException::EndFunction.  There should not be any 
functionality change from doing this, but I'm not an EH expert.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98459 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 01:41:15 +00:00
Chris Lattner
1b2eb0e8a6 eliminate the now-unneeded context argument of MBB::getSymbol()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98451 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 21:04:28 +00:00
Chris Lattner
11d53c129f rearrange MCContext ownership. Before LLVMTargetMachine created it
and passing off ownership to AsmPrinter.  Now MachineModuleInfo
creates it and owns it by value.  This allows us to use MCSymbols
more consistently throughout the rest of the code generator, and
simplifies a bit of code.  This also allows MachineFunction to 
keep an MCContext reference handy, and cleans up the TargetRegistry
interfaces for AsmPrinters.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98450 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 20:55:24 +00:00
Chris Lattner
3889fac428 add builder support for mcsymbol operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98434 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 08:16:25 +00:00
Chris Lattner
72aaa3c798 add support for MCSymbols as operands to MachineInstrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98433 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 08:14:18 +00:00
Benjamin Kramer
669f6b3bee Add some parens and silence a warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98428 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 07:40:34 +00:00
Daniel Dunbar
5e6a7a248b llvm-mc: Support -n, useful for comparing -integrated-as output since the
compiler may not lead with the text section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98418 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 02:20:57 +00:00
Jeffrey Yasskin
6f555ca2cd Delete MDNodes when LLVMContext is destroyed. Previous attempts: r97918, r97788.
Tested: clang debug bootstrap, llvm-gcc bootstrap, `make check-lit`
after configuring with --with-llvmgccdir (and this did run the
FrontendC* tests this time)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98410 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 01:26:15 +00:00
Devang Patel
f96769bed2 Remove extra parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98403 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 00:45:31 +00:00
Devang Patel
cbd056074c Do not overestimate code size reduction in presense of debug info.
Use CodeMetrics.analyzeBasicBlock() to estimate BB size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98401 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 00:10:20 +00:00
Daniel Dunbar
f08fde41f3 MC/Mach-O: Implement initial support for relaxation.
- The implementation is currently very brain dead and inefficient, but I have a
   clear plan on how to fix it.

 - The good news is, it works and correctly assembles 403.gcc (when built with
   Clang, at '-Os', '-Os -g', and '-O3'). Even better, at '-Os' and '-Os -g',
   the resulting binary is exactly equivalent to that when built with the system
   assembler. So it probably works! :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98396 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 22:07:14 +00:00
Chris Lattner
d62f1b4168 inline GetGlobalValueSymbol into the rest its callers and
remove it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98390 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 21:19:23 +00:00
Chris Lattner
b6fc4a5650 eliminate the X86 version of GetGlobalValueSymbol, allowing
it to be non-virtual and soon disappear.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98387 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 21:06:41 +00:00
Chris Lattner
8a29fa6e02 move fastcall/stdcall mangling up into Mangler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98384 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 21:03:47 +00:00
Daniel Dunbar
df3c8f2969 MC: Factor out MCAssembler::EvaluateFixup, and simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98381 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 21:00:49 +00:00
Daniel Dunbar
a0e36d55c4 MC: Constify MCAsmLayout argument to MCExpr::EvaluteAs...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98380 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 21:00:45 +00:00
Daniel Dunbar
8315a357e4 MC: Add MCAssembler::addFixup, which enforces that fixups are added in order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98379 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 21:00:38 +00:00
Chris Lattner
b87c305fa7 give Mangler access to TargetData.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 20:47:28 +00:00
Benjamin Kramer
a30b181c20 Add a virtual destructor and give vtable a home.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98376 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 20:41:29 +00:00
Chris Lattner
73ff564d65 finally give Mangler a getSymbol method, which returns an MCSymbol
for a global instead of messing around with string buffers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98366 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 18:55:20 +00:00
Chris Lattner
5ef31a039d make the mangler take an MCContext instead of an MAI.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98363 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 18:44:54 +00:00
Chris Lattner
fdab14b105 remove MAI argument from createAsmStreamer since it
can get it from the context now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98361 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 18:28:53 +00:00
Jeffrey Yasskin
5c213dc78c Free DbgScopes in DwarfDebug::endFunction(). Also increased the const-ness of
several fields to make it easier to figure out where bugs might be creeping in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98358 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 17:45:06 +00:00
Benjamin Kramer
0b6cb50738 Factor checked library call optimization into a common helper class and use it
to unify the almost identical code in CodeGenPrepare and InstCombineCalls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98338 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 09:27:41 +00:00
Chris Lattner
f789d26f81 make TargetLoweringObjectFile::getExprForDwarfReference
just make unnamed temp symbols instead of having to come
up with its own names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98324 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 01:56:43 +00:00
Nate Begeman
75d5fe9213 Whoops this already existed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98297 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 23:21:19 +00:00
Nate Begeman
47a53a6e4c Add a handful of additional useful pass manager things to the C API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98296 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 23:06:07 +00:00
Chris Lattner
c18409aed8 change MCContext to always have an MCAsmInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98293 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 22:53:35 +00:00
Chris Lattner
42263e2e40 fix a fixme in TargetLoweringObjectFile::getExprForDwarfReference
where we used ot create an MCSymbol for ".".  Now emit an assembler
temporary label and reference it instead of "." textually.

rdar://7739457


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98292 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 21:55:20 +00:00
Dan Gohman
a257095ebb Remove getWidenVectorType, which is no longer used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98289 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 21:39:57 +00:00
Benjamin Kramer
7fa30b8e5d stpcpy is so similar to strcpy, it doesn't deserve a complete copy of the __strcpy_chk -> strcpy code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98284 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 20:45:13 +00:00
Chris Lattner
3192d14076 rename getSymbolForDwarf* to getExprForDwarf* since it returns
an MCExpr and not an MCSymbol.  Change it to take an MCStreamer,
which is currently unused.

No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98278 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 19:41:58 +00:00
Eric Christopher
19888ca8b4 Lower stpcpy_chk when possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98274 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 19:24:34 +00:00
Daniel Dunbar
8f0448cabc MC/Mach-O: Add MCSymbolData::getAddress() utility.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98266 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 18:22:51 +00:00
Richard Osborne
95da605e15 Add a new jump table encoding to indicate jump tables entries
are inside the function by the target at the point of use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98255 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 14:58:16 +00:00
Evan Cheng
826cbac2a0 The check for coalescing a virtual register to a physical register, e.g.
cl = EXTRACT_SUBREG reg1024, 1, is overly conservative. It should check
for overlaps of vr's live interval with the super registers of the
physical register (ECX in this case) and let JoinIntervals() handle checking
the coalescing feasibility against the physical register (cl in this case).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98251 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 08:20:21 +00:00
Daniel Dunbar
18ff2cced7 MC/Mach-O: Start passing in the basic MCAsmLayout object.
- Also, drop the current location part of AsmLayout, I think I prefer to implement this via explicit symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98240 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 05:53:33 +00:00
Daniel Dunbar
f82f4490b1 MC: Sketch initial MCAsmLayout class, which encapsulates the current layout of an assembly file. The MCAsmLayout is also available for use by MCExpr::EvaluateAs{Absolute,Relocatable}, to allow target specific hooks and "absolutizing" of symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98227 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 02:28:59 +00:00
Daniel Dunbar
18e2c021a9 Fix (unused) RegisterAsmBackend template, clang++ isn't happy about this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98226 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 02:28:52 +00:00
Daniel Dunbar
1f3e445184 MC: Provide MCAssembler with a TargetAsmBackend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98222 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 01:34:27 +00:00
Daniel Dunbar
23ac7c78e4 MC: Sketch some TargetAsmBackend hooks we are going to need.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98221 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 01:34:21 +00:00
Daniel Dunbar
6c27f5e574 MC: Provide the target triple to AsmBackend constructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98220 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 01:34:16 +00:00
Eric Christopher
bd97376200 Add strncpy libcall creator. Use it when it should be used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98219 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 01:25:07 +00:00
Dale Johannesen
ae47e461eb Make sure HasDebugValue is initialized. This should fix
the buildbot running valgrind.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98216 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 00:52:12 +00:00
Chris Lattner
2968943463 add support, testcases, and dox for the new GHC calling
convention.  Patch by David Terei!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98212 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 00:22:57 +00:00
Bill Wendling
cebae36f57 Add a bit along with the MCSymbols stored in the MachineModuleInfo maps that
indicates that an MCSymbol is external or not. (It's true if it's external.)
This will be used to specify the correct information to add to non-lazy
pointers. That will be explained further when this bit is used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98199 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 22:34:10 +00:00
Dale Johannesen
bfdf7f3852 Progress towards shepherding debug info through SelectionDAG.
No functional effect yet.  This is still evolving and should
not be viewed as final.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98195 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 22:13:47 +00:00
Daniel Dunbar
46836a783a MC: Move the backend section and symbol data maps to MCAssembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98186 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 20:58:29 +00:00
Daniel Dunbar
d80066eea9 Remove unneeded declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98185 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 20:58:25 +00:00
Dan Gohman
bbf81d8811 Add a DominatorTree argument to isLCSSA so that it doesn't have to
compute a set of reachable blocks for itself each time it is called, which
is fairly frequently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98179 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 19:38:49 +00:00
Benjamin Kramer
48ee0bbb72 Remove duplicated code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98156 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 16:04:20 +00:00
Chris Lattner
09d53fecfc move three lowering hooks from MAI to TLOF and make one of them
semantic instead of syntactic.  This completes MCization of
darwin/x86[-64]!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98145 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 07:20:42 +00:00
Chris Lattner
98cdab53c3 set the temporary bit on MCSymbols correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98124 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 02:25:11 +00:00
Chris Lattner
00685bb5cf eliminate MCContext::CreateSymbol and CreateTemporarySymbol.
Add a new GetOrCreateTemporarySymbol method and a version that
takes a twine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98118 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 01:29:27 +00:00
Jakob Stoklund Olesen
f7477470d3 Try to keep the cached inliner costs around for a bit longer for big functions.
The Caller cost info would be reset everytime a callee was inlined. If the
caller has lots of calls and there is some mutual recursion going on, the
caller cost info could be calculated many times.

This patch reduces inliner runtime from 240s to 0.5s for a function with 20000
small function calls.

This is a more conservative version of r98089 that doesn't break the clang
test CodeGenCXX/temp-order.cpp. That test relies on rather extreme inlining
for constant folding.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98099 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 23:02:17 +00:00
Jakob Stoklund Olesen
b5a158bab8 Revert r98089, it was breaking a clang test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98094 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 22:43:37 +00:00
Jakob Stoklund Olesen
9e5d87d568 Try to keep the cached inliner costs around for a bit longer for big functions.
The Caller cost info would be reset everytime a callee was inlined. If the
caller has lots of calls and there is some mutual recursion going on, the
caller cost info could be calculated many times.

This patch reduces inliner runtime from 240s to 0.5s for a function with 20000
small function calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98089 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 22:17:11 +00:00
Jim Grosbach
dff4b4c5a7 Change the Value argument to eliminateFrameIndex to a type-tagged value. This
is preparatory to having PEI's scavenged frame index value reuse logic
properly distinguish types of frame values (e.g., whether the value is
stack-pointer relative or frame-pointer relative).

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 21:45:49 +00:00
Chris Lattner
c608784dc8 reapply r98035:
Now that setStartLabel takes an MCSymbol, we can de-ID'ize
beginScope and RecordSourceLine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98047 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 04:54:43 +00:00
Eric Christopher
ee6414cf04 Speculatively revert r98035. It appears to have caused a set of buildbot
failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98039 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 02:36:31 +00:00
Chris Lattner
1e233f510c Now that setStartLabel takes an MCSymbol, we can de-ID'ize
beginScope and RecordSourceLine.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98035 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 02:08:02 +00:00
Chris Lattner
a34ec2290f strength reduce MMI::MappedLabel to MMI::isLabelDeleted,
and add a FIXME about how we are eventually going to zap this
lookup table once mc world domination is complete.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98031 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 01:51:43 +00:00
Chris Lattner
23071ce80b inline RemapLabel into its only caller and simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98029 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 01:29:59 +00:00
Devang Patel
4b945500a5 Start using DIFile. See updated SourceLevelDebugging.html for more information.
This patch updates LLVMDebugVersion to 8.
Debug info descriptors encoded using LLVMDebugVersion 7 is supported.

Corresponding llvmgcc and clang FE commits are required.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98020 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 00:44:10 +00:00