Commit Graph

8713 Commits

Author SHA1 Message Date
Chris Lattner
74bfe21b50 Now that we have everything nicely factored (e.g. asmprinter is not
doing global variable classification anymore) and hookized, sink almost
all target targets global variable emission code into AsmPrinter and out
of each target.

Some notes:

1. PIC16 does completely custom and crazy stuff, so it is not changed.
2. XCore has some custom handling for extra directives.  I'll look at it next.
3. This switches linux/ppc to use .globl instead of .global.  If .globl is
   actually wrong, let me know and I'll fix it.
4. This makes linux/ppc get a lot of random cases right which were obviously
   wrong before, it is probably now a bit healthier.
5. Blackfin will probably start getting .comm and other things that it didn't
   before.  If this is undesirable, it should explicitly opt out of these
   things by clearing the relevant fields of MCAsmInfo.

This leads to a nice diffstat:
 14 files changed, 127 insertions(+), 830 deletions(-)




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93858 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 05:38:33 +00:00
Chris Lattner
48d64ba9d8 hoist handling of external globals and special globals up to common code.
This makes a similar code dead in all the other targets, I'll clean it up
in a bit.

This also moves handling of lcomm up before acquisition of a section,
since lcomm never needs a section.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93851 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 04:39:15 +00:00
Chris Lattner
71eae71315 move production of .reference directives for static ctor/dtor list on
darwin into common code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93849 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 04:34:02 +00:00
Devang Patel
f54b85237c Revert accident check-in from r93165.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93832 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 01:26:02 +00:00
Dale Johannesen
f082d7abe1 Revert 93811 per request.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93818 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 00:10:52 +00:00
Dale Johannesen
1b346b7f8f Enable code to emit dbg.declare as DEBUG_VALUE
comments (fast isel, X86).  This doesn't seem
to break any functionality, but will introduce
cases where -g affects the generated code.  I'll
be fixing that.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93811 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 23:34:55 +00:00
Evan Cheng
1ad0e8b576 Canonicalize -1 - x to ~x.
Instcombine does this but apparently there are situations where this pattern will escape the optimizer and / or created by isel. Here is a case that's seen in JavaScriptCore:
  %t1 = sub i32 0, %a
  %t2 = add i32 %t1, -1
The dag combiner pattern: ((c1-A)+c2) -> (c1+c2)-A
will fold it to -1 - %a.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93773 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 21:38:44 +00:00
Bill Wendling
a8c18890da - Add a comment to the callback indicating that it's *extremely* not a good
idea, but unfortunately necessary.
- Default to using 4-bytes for the LSDA pointer encoding to agree with the
  encoded value in the CIE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93753 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 19:36:27 +00:00
Chris Lattner
8cb9a3b13f remove the MAI argument to MCExpr::print and switch overthing to use << when printing them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93699 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 00:37:40 +00:00
Chris Lattner
10b318bcb3 now that MCSymbol::print doesn't use it's MAI argument, we can
remove it and change all the code that prints MCSymbols to use 
<< instead, which is much simpler and cleaner.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93695 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-17 21:43:43 +00:00
Chris Lattner
c0dba723d1 now that mangler is in libtarget, it can use MCAsmInfo instead of clients
having to pass various fields from it in.  Simplify.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93686 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-17 18:22:35 +00:00
Benjamin Kramer
1efd4fd56b Switch some functions to take Twines, eliminate uses of StringExtras.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93680 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-17 07:46:39 +00:00
Nate Begeman
6f24a0a603 Add a note for the macho streamer and remove a used of the mangler from the soon to be defunct machowriter pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93670 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-17 03:49:01 +00:00
Kenneth Uildriks
93ae407ec3 When checking for sret-demotion, it needs to use legal types. When using the return value of an sret-demoted call, it needs to use possibly illegal types that match the declared Type of the callee.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 23:37:33 +00:00
Chris Lattner
45111d160c move the mangler into libtarget from vmcore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93664 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 21:57:06 +00:00
Chris Lattner
c94c825a40 reapply the mangler gutting patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93656 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 21:08:46 +00:00
Chris Lattner
6dfdad9c06 unbreak the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93654 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 20:53:11 +00:00
Rafael Espindola
0f0c97810c Revert 93648.
Mangler::getMangledName is used from lto
Mangler::setUseQuotes is used in the AsmPrinter
Mangler::setSymbolsCanStartWithDigit is used in the AsmPrinter


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93652 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 20:27:59 +00:00
Chris Lattner
848d0f37d2 Mangler::getMangledName is now dead, remove it and all the other stuff in Mangler that is now transitively dead. woo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93648 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 19:08:51 +00:00
Chris Lattner
858431d0bc Change DIEObjectLabel to take an MCSymbol instead of std::string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93647 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 18:50:28 +00:00
Chris Lattner
7a2ba94d03 rename GetPrivateGlobalValueSymbolStub -> GetSymbolWithGlobalValueBase,
and add an explicit ForcePrivate argument.

Switch FunctionEHFrameInfo to be MCSymbol based instead of string based.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93646 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 18:37:32 +00:00
Chris Lattner
08ce3b473d eliminate uses of getMangledName from AsmPrinter.cpp, last up is
dwarf emission which is going to be more invasive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93645 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 18:17:26 +00:00
Devang Patel
a27f6e4e20 No need to use WeakVH here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 06:17:40 +00:00
Devang Patel
6b61f5816e Replace DebugLocTuple with DILocation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93630 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 06:09:35 +00:00
Chris Lattner
0b3735e65a remove a couple of actively incorrect uses of getMangledName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93627 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 02:16:09 +00:00
Bill Wendling
d58e9cb42d Retrying r91337:
The CIE says that the LSDA point in the FDE section is an "sdata4". That's fine,
but we need it to actually be 4-bytes in the FDE for some platforms. Allow
individual platforms to decide for themselves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93616 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 01:40:55 +00:00
Chris Lattner
10595490cc fix inverted conditional
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93614 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 01:37:14 +00:00
Chris Lattner
412c3a5bc9 CurrentFnName is now dead, remove it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93612 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 01:24:10 +00:00
Chris Lattner
5c40e694dc remove the string form of printVisibility.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93609 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 01:17:26 +00:00
Bob Wilson
cb44b28f4d Treat indirect branches specially only during pre-regalloc tail duplication,
not during the later post-alloc tail duplication.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93600 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 00:42:25 +00:00
Bob Wilson
516ab96de3 Run the pre-register allocation tail duplication pass by default. Remove
the -pre-regalloc-taildup command-line option, and add a new
-disable-early-taildup option.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93597 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 00:29:50 +00:00
Chris Lattner
d1947ed2f8 supplement CurrentFnName with CurrentFnSym, which will eventually
replace it.  Upgrade Alpha, Blackfin, and part of CellSPU to not
use mangler anymore.  CellSPU needs more invasive surgery.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93589 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 23:55:16 +00:00
Chris Lattner
53d4d78d9a add a version of AsmPrinter::printVisibility that takes an MCSymbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93587 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 23:38:51 +00:00
Chris Lattner
d588b97cc9 add another helper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93577 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 23:25:11 +00:00
Chris Lattner
6b04edee11 add a AsmPrinter::GetGlobalValueSymbol and GetExternalSymbolSymbol
helper method, use it to simplify some code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93575 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 23:18:17 +00:00
Ted Kremenek
11f30b0131 Update CMake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93571 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 22:59:46 +00:00
Devang Patel
167207a99b Add FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93562 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 22:08:16 +00:00
Jakob Stoklund Olesen
33cc8d6b55 Don't make changes to the MBB in MachineBasicBlock::canFallThrough().
This fixes the regression for -pre-regalloc-taildup in
MultiSource/Applications/lambda-0.1.3.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93541 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 20:00:12 +00:00
Jakob Stoklund Olesen
057d53993c Simplify logic. Any functional change is unintended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93540 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 19:59:57 +00:00
David Greene
ac931c011f Add some debug routines to SelectionDAG to dump full DAGs.
print/dumpWithDepth allows one to dump a DAG up to N levels deep.
dump/printWithFullDepth prints the whole DAG, subject to a depth limit
on 100 in the default case (to prevent infinite recursion).

Have CannotYetSelect to a dumpWithFullDepth so it is clearer exactly
what the non-matching DAG looks like.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93538 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 19:43:23 +00:00
Victor Hernandez
3a32865d58 Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare.
It also strips old llvm.dbg.declare intrinsics that did not pass metadata as the first argument.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93531 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 19:04:09 +00:00
Nate Begeman
3fe980b127 Hook up llc's -filetype=obj to use MCStreamer if an MCCodeEmitter is available.
Remove most of old Mach-O Writer support, it has been replaced by MCMachOStreamer

Further refactoring to completely remove MachOWriter and drive the object file
writer with the AsmPrinter MCInst/MCSection logic is forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93527 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 18:51:18 +00:00
Victor Hernandez
5f03238d62 Revert r93504 because older uses of llvm.dbg.declare intrinsics need to be auto-upgraded
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93515 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 17:36:47 +00:00
Bob Wilson
bfdcf3bd49 Change pre-regalloc tail duplication to only duplicate indirect branch blocks.
The pre-regalloc pass caused some regressions in both compile time and
performance of the generated code, and it did not improve performance, except
for indirect branches.  I also moved the check for single-block loops to speed
up the common case when running the taildup pass before reg allocation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93505 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 06:29:17 +00:00
Victor Hernandez
283ba2fbb4 Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93504 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 03:37:48 +00:00
Devang Patel
c9b16cc108 Do not use AT_specification die for static variables. It confuses gdb.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93494 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 01:12:22 +00:00
Jim Grosbach
f4549b02a7 fix 80-column violations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93487 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 00:36:15 +00:00
Jim Grosbach
03825f8401 Fix 80 column violations and clean up whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93484 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 00:32:47 +00:00
Devang Patel
f8b72ca6c8 Do not emit multiple AT_container_type attributes.
We need to find a better way to emit this info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93481 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 00:26:31 +00:00
Dale Johannesen
cf0b76649b Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93463 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 21:50:17 +00:00