Commit Graph

35416 Commits

Author SHA1 Message Date
Bruno Cardoso Lopes
8c5ee7147b Fix a bug introduced on r92564 where the name "Node" was already
in use by Mips.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93897 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 19:57:07 +00:00
Chris Lattner
aaec205b87 Generalize mcasmstreamer data emission APIs to take an address space
identifier.  There is no way to work around it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93896 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 19:46:13 +00:00
Evan Cheng
590d16be6f Do not extend extension results beyond the use of a PHI instruction at the start of a use block. A PHI use is expected to kill its source values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93895 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 19:45:51 +00:00
Chris Lattner
91093ecf0f refactor code to be static functions instead of methods on AsmPrinter.
This fixes some bugs handling address spaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93891 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 19:10:44 +00:00
Chris Lattner
8a6d7ac88f mcstreamerize AsmPrinter::EmitZeros, at least when emitting to the
default address space.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93890 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 18:58:52 +00:00
Chris Lattner
6113b3d323 add an MCAsmStreamer::EmitFill specialization of EmitFill that
emits one directive instead of N.  Not doing this would be a
significant regression on the # bytes generated by .fill.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93889 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 18:52:28 +00:00
Chris Lattner
ddf6bdde44 add a "MCStreamer::EmitFill" method, and move the default implementation
(which just iteratively emits bytes) to MCStreamer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 18:45:47 +00:00
Chris Lattner
f03ffd13f8 remove MAI::ZeroDirectiveSuffix, which is only used by MASM,
which we don't support anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93886 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 18:37:01 +00:00
Jim Grosbach
e45ab8a0a9 For aligned load/store instructions, it's only required to know whether a
function can support dynamic stack realignment. That's a much easier question
to answer at instruction selection stage than whether the function actually
will have dynamic alignment prologue. This allows the removal of the
stack alignment heuristic pass, and improves code quality for cases where
the heuristic would result in dynamic alignment code being generated when
it was not strictly necessary.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93885 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 18:31:11 +00:00
Chris Lattner
c0404b3715 optimize ~(~X >>s Y) --> (X >>s Y), patch by Edmund Grimley
Evans!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93884 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 18:16:19 +00:00
Bruno Cardoso Lopes
9201b10daa On pic function calls some arguments were marked dead and
the instruction to load those args removed. This fix PR6071


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93880 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 17:00:43 +00:00
Bruno Cardoso Lopes
ea98278935 load f64 +0.0 in a cleaner way. This fix part of PR5445
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93876 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 12:53:04 +00:00
Bruno Cardoso Lopes
e5ebd5f2ae Fix return registers for mips eabi
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93875 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 12:37:35 +00:00
Chris Lattner
4c8c668b57 mcstreamer'ize the rest of EmitGlobalVariable that is used on
darwin.  The next big piece to get global variables streamerized
is EmitGlobalConstant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93870 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 06:41:24 +00:00
Chris Lattner
814819f6ea stop using the .lcomm pseudoop on darwin, instead, directly use the
.zerofill directive.  Streamerize its generation.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93868 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 06:25:51 +00:00
Devang Patel
622b02601b MDNodes are not expected to disappear or replaced by another MDNode, so there is no need to pay the cost of WeakVH and ValueMaps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93865 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 06:19:05 +00:00
Devang Patel
c99fd879c0 Avoid including DebugInfo.h in AsmPrinter.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93864 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 06:09:04 +00:00
Chris Lattner
8ad9a77501 zap the ARM version of PrintGlobalVariable, which I missed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93863 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 06:08:15 +00:00
Chris Lattner
4ed5438f48 mc'ize some stuff, don't comment out .lcomm directive in -fverbose-asm mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93860 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 06:01:04 +00:00
Chris Lattner
9744d611d7 factor this code better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93859 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 05:51:42 +00:00
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
074f837bbb use %object like other elf targets, gas accepts either.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93857 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 05:25:38 +00:00
Chris Lattner
07c2bc04f9 simplify the mips target to print .size and .type for c strings
just like all other elf targets.  Bruno, if this isn't right, please
let me know + why :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93856 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 05:23:59 +00:00
Chris Lattner
41eb8b4771 hookize the cygwin ".linkonce" directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93855 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 05:08:13 +00:00
Chris Lattner
619ea855e7 more cleanups. Emit the .local directive even on cygwin/mingw.
I'm not sure that this is correct, but it causes no test failures,
and just emitting a .comm without protecting its linkage somehow
is surely not right.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93854 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 04:59:55 +00:00
Chris Lattner
cfd910ebc4 some cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93853 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 04:53:18 +00:00
Chris Lattner
7517b249ca add a bool for whether .lcomm takes an alignment instead of basing this on "isdarwin".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93852 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 04:48:20 +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
Bob Wilson
a756b1d914 Fix a crash in scalarrepl for memcpy/memmove where the source and destination
are the same.  I had already fixed a similar problem where the source and
destination were different bitcasts derived from the same alloca, but the
previous fix still did not handle the case where both operands are exactly
the same value.  Radar 7552893.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93848 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 04:32:48 +00:00
Chris Lattner
c1ef06ac52 use BSSLocal classifier to identify 'lcomm' data instead of
duplicating the logic (differently) in lots of different targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 04:21:20 +00:00
Chris Lattner
ce8749e445 make TLOF subclassify BSS based on linkage type into private, external
and everything else (weak).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93846 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 04:15:51 +00:00
Chris Lattner
56b1319fbe now that elf weak bss symbols are handled correctly, simplify a bunch of code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93845 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 03:13:44 +00:00
Chris Lattner
c7fbe90389 fix a significant difference between llvm and gcc on ELF systems:
GCC would put weak zero initialized mutable data in the .bss section,
we would put it into a crasy '.gnu.linkonce.b.test,"aw",@nobits' 
section.  Fixing this will allow simplifications next up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93844 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 03:06:01 +00:00
Chris Lattner
a3839bc371 introduce a section kind for common linkage. Use this to slightly
simplify and commonize some of the asmprinter logic for globals.

This also avoids printing the MCSection for .zerofill, which broke
the llvm-gcc build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 02:48:26 +00:00
Bill Wendling
e1e0f485f9 Even more explanation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93841 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 02:44:01 +00:00
Chris Lattner
6e3be14be4 change an accessor to a predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93839 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 02:13:06 +00:00
Chris Lattner
aac138e84d Cleanup handling of .zerofill on darwin:
1. TargetLoweringObjectFileMachO should decide if something
   goes in zerofill instead of having every target do it.
2. TargetLoweringObjectFileMachO should assign said symbols to
   the right MCSection, the asmprinters should just emit to the
   right section.
3. Since all zerofill stuff goes through mcstreamer anymore,
   MAI can have a bool "haszerofill" instead of having the textual
   directive to emit.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93838 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 02:09:44 +00:00
Nate Begeman
60a17740b8 Remove this fixme, looking at the linker source, all targets pad to 4 bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93835 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 01:32:44 +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
Eric Christopher
d3dc3cc98f Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93831 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 01:20:15 +00:00
Evan Cheng
f609bb8466 Fix r93758. Use isel patterns instead of c++ selection code to select rbit and make sure we pick different instructions for ARM vs. Thumb2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93829 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 00:44:15 +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
Victor Hernandez
6cead7879a Add comment that MDNode::getFunction() is not to be used by performance-critical code (currently only used by AsmWriter)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93802 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:55:08 +00:00
Eli Friedman
9cfb3adf44 Add some potentially interesting transformations to README.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93797 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:36:59 +00:00
Bill Wendling
48814681d7 - Add getLSDAEncoding to the PowerPC backend.
- Greatly improve the comments to the getLSDAEncoding method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93796 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:36:35 +00:00
Chris Lattner
cd5adbbc0c my instcombine transformations to make extension elimination more
aggressive changed the canonical form from sext(trunc(x)) to ashr(lshr(x)),
make sure to transform a couple more things into that canonical form,
and catch a case where we missed turning zext/shl/ashr into a single sext.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93787 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:19:16 +00:00
Eric Christopher
77f79895f8 Have FastISel handle llvm.trap().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93781 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:11:29 +00:00
Jim Grosbach
6a19947dd6 Minor cleanup for jump table printing. Need a reference, not a pointer, for
printing via <<. Otherwise we just print the pointer value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93777 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:01:39 +00:00