1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
Commit Graph

56195 Commits

Author SHA1 Message Date
Chris Lattner
377bd87849 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(-)

llvm-svn: 93858
2010-01-19 05:38:33 +00:00
Chris Lattner
17135fc4b8 use %object like other elf targets, gas accepts either.
llvm-svn: 93857
2010-01-19 05:25:38 +00:00
Chris Lattner
baaf5eae3c 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 :)

llvm-svn: 93856
2010-01-19 05:23:59 +00:00
Chris Lattner
f0edf967c7 hookize the cygwin ".linkonce" directive.
llvm-svn: 93855
2010-01-19 05:08:13 +00:00
Chris Lattner
4ffb7d26a2 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.

llvm-svn: 93854
2010-01-19 04:59:55 +00:00
Chris Lattner
fce81941eb some cleanups
llvm-svn: 93853
2010-01-19 04:53:18 +00:00
Chris Lattner
7351e3a364 add a bool for whether .lcomm takes an alignment instead of basing this on "isdarwin".
llvm-svn: 93852
2010-01-19 04:48:20 +00:00
Chris Lattner
f904832189 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.

llvm-svn: 93851
2010-01-19 04:39:15 +00:00
Chris Lattner
3821a5f168 move production of .reference directives for static ctor/dtor list on
darwin into common code.

llvm-svn: 93849
2010-01-19 04:34:02 +00:00
Bob Wilson
e94d77854f 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.

llvm-svn: 93848
2010-01-19 04:32:48 +00:00
Chris Lattner
b5e64bd377 use BSSLocal classifier to identify 'lcomm' data instead of
duplicating the logic (differently) in lots of different targets.

llvm-svn: 93847
2010-01-19 04:21:20 +00:00
Chris Lattner
63ef960b83 make TLOF subclassify BSS based on linkage type into private, external
and everything else (weak).

llvm-svn: 93846
2010-01-19 04:15:51 +00:00
Chris Lattner
eeebf5a580 now that elf weak bss symbols are handled correctly, simplify a bunch of code.
llvm-svn: 93845
2010-01-19 03:13:44 +00:00
Chris Lattner
c42d723862 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.

llvm-svn: 93844
2010-01-19 03:06:01 +00:00
Chris Lattner
77f12b9ee0 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.

llvm-svn: 93843
2010-01-19 02:48:26 +00:00
Chris Lattner
394370b299 there is no need to emit a .section above .comm on linux.
llvm-svn: 93842
2010-01-19 02:46:56 +00:00
Bill Wendling
1e66a08920 Even more explanation.
llvm-svn: 93841
2010-01-19 02:44:01 +00:00
Chris Lattner
53d8210a69 change an accessor to a predicate.
llvm-svn: 93839
2010-01-19 02:13:06 +00:00
Chris Lattner
816fcd1287 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.

llvm-svn: 93838
2010-01-19 02:09:44 +00:00
Nate Begeman
3c96073ce7 Remove this fixme, looking at the linker source, all targets pad to 4 bytes.
llvm-svn: 93835
2010-01-19 01:32:44 +00:00
Chris Lattner
fa545150c4 remove extraneous ;
llvm-svn: 93833
2010-01-19 01:28:09 +00:00
Devang Patel
885bd38bfc Revert accident check-in from r93165.
llvm-svn: 93832
2010-01-19 01:26:02 +00:00
Eric Christopher
5b602f9bf7 Fix comment.
llvm-svn: 93831
2010-01-19 01:20:15 +00:00
Evan Cheng
f1a3f81a1d Fix r93758. Use isel patterns instead of c++ selection code to select rbit and make sure we pick different instructions for ARM vs. Thumb2.
llvm-svn: 93829
2010-01-19 00:44:15 +00:00
Evan Cheng
572390be3b Test case for r93758.
llvm-svn: 93824
2010-01-19 00:35:20 +00:00
Dale Johannesen
5565ddfcbe Reverting.
llvm-svn: 93819
2010-01-19 00:12:05 +00:00
Dale Johannesen
e1ba7ecf45 Revert 93811 per request.
llvm-svn: 93818
2010-01-19 00:10:52 +00:00
Dale Johannesen
0b8b2713d3 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.

llvm-svn: 93811
2010-01-18 23:34:55 +00:00
Victor Hernandez
edcdd08463 Add comment that MDNode::getFunction() is not to be used by performance-critical code (currently only used by AsmWriter)
llvm-svn: 93802
2010-01-18 22:55:08 +00:00
Eli Friedman
45d605c120 Make opt -O3 act more like clang -O3 etc., by making the inlining thresholds
match.

llvm-svn: 93798
2010-01-18 22:38:31 +00:00
Eli Friedman
0aade63ca6 Add some potentially interesting transformations to README.
llvm-svn: 93797
2010-01-18 22:36:59 +00:00
Bill Wendling
58d26c105b - Add getLSDAEncoding to the PowerPC backend.
- Greatly improve the comments to the getLSDAEncoding method.

llvm-svn: 93796
2010-01-18 22:36:35 +00:00
Chris Lattner
39532b939f make llvm-config more portable to windows versions of perl,
patch by Michael Beck!

llvm-svn: 93793
2010-01-18 22:27:43 +00:00
Chris Lattner
6cd7a81f86 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.

llvm-svn: 93787
2010-01-18 22:19:16 +00:00
Sean Callanan
3439b1e14c Added a newline at the end of SMLoc.h
llvm-svn: 93784
2010-01-18 22:16:54 +00:00
Sean Callanan
f6a09ee2ec Changed the comment in the file header for SMLoc
to something more accurate.

llvm-svn: 93782
2010-01-18 22:11:34 +00:00
Eric Christopher
f599e07003 Have FastISel handle llvm.trap().
llvm-svn: 93781
2010-01-18 22:11:29 +00:00
Sean Callanan
aef98cfcd2 Split SMLoc out in its own header so that it can
be used independently of SourceMgr.

llvm-svn: 93780
2010-01-18 22:07:51 +00:00
Jim Grosbach
27e064420b Minor cleanup for jump table printing. Need a reference, not a pointer, for
printing via <<. Otherwise we just print the pointer value.

llvm-svn: 93777
2010-01-18 22:01:39 +00:00
Chris Lattner
6020407d78 filecheckize this.
llvm-svn: 93776
2010-01-18 22:00:46 +00:00
Chris Lattner
a01771c6db filecheckize
llvm-svn: 93775
2010-01-18 21:58:32 +00:00
Chris Lattner
882bcda7ca remove a redundant test, filecheckize another.
llvm-svn: 93774
2010-01-18 21:55:43 +00:00
Evan Cheng
5cf9d23e4e 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.

llvm-svn: 93773
2010-01-18 21:38:44 +00:00
Chris Lattner
b9ad4c901e update mkpatch, patch by Garrison Venn!
llvm-svn: 93771
2010-01-18 21:09:05 +00:00
Victor Hernandez
afaac26fea Make findDbgDeclare/findDbgGlobalDeclare local static functions; avoid Elts array
llvm-svn: 93764
2010-01-18 20:42:09 +00:00
Victor Hernandez
247ec55125 Simplify MDNode::getFunction() and assertLocalFunction() by avoiding extra Function* variable and smallptrset since function-local metadata cannot be cyclic
llvm-svn: 93762
2010-01-18 20:36:54 +00:00
Johnny Chen
a5f79a6b93 The most significant encoding bit of GPR:$src or GPR:$dst was over-specified in
the various MOV (register) instructions (16-bit Thumb), including tBRIND (the
indirect branch).  Instead of '1', it should be specified as '?', because GPR
only specifies the register class, which includes both hi-and-lo registers.

llvm-svn: 93759
2010-01-18 20:15:56 +00:00
Jim Grosbach
70af2216fd Patch by David Conrad:
"On ARMv6T2 this turns cttz into rbit, clz instead of the 4 instruction
 sequence it is now."

llvm-svn: 93758
2010-01-18 19:58:49 +00:00
Devang Patel
2cae5754c6 While mapping llvm.dbg.declare intrinsic manually map its operand, if possible,
because it points to an alloca instruction through metadata.

llvm-svn: 93757
2010-01-18 19:52:14 +00:00
Chris Lattner
4104b0bccd reject some invalid IR. We already assert and reject this from the
.ll parser, but PR6070 wants it in the verifier too.

llvm-svn: 93756
2010-01-18 19:50:32 +00:00