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

56585 Commits

Author SHA1 Message Date
Duncan Sands
3cd86bc569 Revert commit 94666 (ddunbar) [Suppress clang warning about unused arguments].
It causes g++ to complain: unrecognized option '-Qunused-arguments'

llvm-svn: 94670
2010-01-27 10:08:08 +00:00
Chris Lattner
d20734ccba add a new AsmPrinter::EmitFunctionEntryLabel virtual function,
which allows targets to override function entry label emission.
Use it to convert linux/ppc to use EmitFunctionHeader().

llvm-svn: 94667
2010-01-27 07:21:55 +00:00
Daniel Dunbar
c1f02aa29c Suppress clang warning about unused arguments.
llvm-svn: 94666
2010-01-27 07:10:10 +00:00
Evan Cheng
381bc804d6 Perform trivial tail call optimization for callees with "C" ABI. These are done
even when -tailcallopt is not specified and it does not require changing ABI.
First case is the most trivial one. Perform tail call optimization when both
the caller and callee do not return values and when the callee does not take
any input arguments.

llvm-svn: 94664
2010-01-27 06:25:16 +00:00
Chris Lattner
3b984e1b99 merge two ifs
llvm-svn: 94650
2010-01-27 02:18:21 +00:00
Chris Lattner
deabd1cfb6 some cleanups.
llvm-svn: 94649
2010-01-27 02:12:20 +00:00
Chris Lattner
354782f9b9 no need to check for null
llvm-svn: 94648
2010-01-27 02:04:20 +00:00
Evan Cheng
a5cb4213ac Remove a dead target hook.
llvm-svn: 94646
2010-01-27 01:44:40 +00:00
Chris Lattner
37c57e69df ppc/linux isn't ready for this and it was an accident that it was included.
This should fix a bunch of linux buildbot failures.

llvm-svn: 94643
2010-01-27 01:02:43 +00:00
Victor Hernandez
e6321dc910 When converting dbg.declare to dbg.value, attach promoted store's debug metadata to dbg.value
llvm-svn: 94634
2010-01-27 00:44:36 +00:00
Victor Hernandez
db86c7d1a0 Linker needs to do deep-copy of function-local metadata to update references to function arguments
llvm-svn: 94632
2010-01-27 00:30:42 +00:00
Chris Lattner
b35edb72c3 use existing basic block numbers instead of recomputing
a new set of them.

llvm-svn: 94631
2010-01-27 00:20:02 +00:00
Chris Lattner
2743ad432d Switch MSP430, CellSPU, SystemZ, Darwin/PPC, Alpha, and Sparc to
EmitFunctionHeader:

7 files changed, 16 insertions(+), 210 deletions(-)

llvm-svn: 94630
2010-01-27 00:17:20 +00:00
Evan Cheng
40c3104c01 Clarify what -tailcallopt option actually do.
llvm-svn: 94628
2010-01-27 00:10:09 +00:00
Jim Grosbach
e96f9c1cab Adjust setjmp instruction sequence to not need 32-bit alignment padding
llvm-svn: 94627
2010-01-27 00:07:20 +00:00
Evan Cheng
237629e476 Eliminate target hook IsEligibleForTailCallOptimization.
Target independent isel should always pass along the "tail call" property. Change
target hook LowerCall's parameter "isTailCall" into a refernce. If the target
decides it's impossible to honor the tail call request, it should set isTailCall
to false to make target independent isel happy.

llvm-svn: 94626
2010-01-27 00:07:07 +00:00
Evan Cheng
631bfe4479 Restore to pre-94570 state.
llvm-svn: 94625
2010-01-27 00:00:57 +00:00
Chris Lattner
45b23cf9b5 mcize label emission for functions.
llvm-svn: 94624
2010-01-26 23:53:39 +00:00
Chris Lattner
ef32178400 use EmitLinkage for functions as well as globals. One output
change is that we now use ".linkonce discard" for global variables
instead of ".linkonce samesize".  These should be the same, just less
strict.  If anyone is interested in mcizing MCSection for COFF targets,
this should be easy to fix.

llvm-svn: 94623
2010-01-26 23:51:52 +00:00
Chris Lattner
ae28b4785d pull linkage emission code out to a new EmitLinkage function.
llvm-svn: 94621
2010-01-26 23:47:12 +00:00
Chris Lattner
2706f29888 rearrange some directives, no functionality change.
llvm-svn: 94620
2010-01-26 23:41:48 +00:00
Jeffrey Yasskin
f021d442f4 Roll r94484 (avoiding RTTI problems in tests) forward again in a way that isn't
broken by setting CXXFLAGS on the command line.

llvm-svn: 94619
2010-01-26 23:30:46 +00:00
Victor Hernandez
4e7937f77b Avoid extra calls to MD->getNumOperands()
llvm-svn: 94618
2010-01-26 23:29:09 +00:00
Evan Cheng
0849122522 Ignore 'forced' tailcall opt in fastisel mode.
llvm-svn: 94617
2010-01-26 23:28:40 +00:00
Chris Lattner
8fe5535cec remove a noop function.
llvm-svn: 94616
2010-01-26 23:26:29 +00:00
Jakob Stoklund Olesen
5d298fdb4c Fix inline cost predictions with SCIENCE.
After running a batch of measurements, it is clear that the inliner metrics
need some adjustments:

Own argument bonus:       20 -> 5
Outgoing argument penalty: 0 -> 5
Alloca bonus:             10 -> 5
Constant instr bonus:      7 -> 5
Dead successor bonus:     40 -> 5*(avg instrs/block)

The new cost metrics are generaly 25 points higher than before, so we may need
to move thresholds.

With this change, InlineConstants::CallPenalty becomes a political correction:

if (!isa<IntrinsicInst>(II) && !callIsSmall(CS.getCalledFunction()))
  NumInsts += InlineConstants::CallPenalty + CS.arg_size();

The code size is accurately modelled by CS.arg_size(). CallPenalty is added
because calls tend to take a long time, so it may not be worth it to inline a
function with lots of calls.

All of the political corrections are in the InlineConstants namespace:
IndirectCallBonus, CallPenalty, LastCallToStaticBonus, ColdccPenalty,
NoreturnPenalty.

llvm-svn: 94615
2010-01-26 23:21:56 +00:00
Chris Lattner
a0df0a28fa now that enough stuff is constified, move function header printing
logic up from X86 into the common code.  The other targets will 
hopefully start using this soon.

llvm-svn: 94614
2010-01-26 23:18:44 +00:00
Chris Lattner
7dbd5458b2 constify a bunch of dwarf stuff now that the registerinfo method
is constified.

llvm-svn: 94613
2010-01-26 23:18:02 +00:00
Chris Lattner
278075333e constify a method argument.
llvm-svn: 94612
2010-01-26 23:15:09 +00:00
Evan Cheng
c674548602 Allow some automatic tailcall optimization without changing ABI.
llvm-svn: 94611
2010-01-26 23:13:04 +00:00
Evan Cheng
ae2bc619e3 Delete blank lines that bug me.
llvm-svn: 94610
2010-01-26 23:07:57 +00:00
Chris Lattner
5680237f34 call emitconstantpool and emitjumptable like other targets.
llvm-svn: 94601
2010-01-26 22:06:58 +00:00
Devang Patel
03be031c4c Before existing NamedMDNode entry in the symbol table, remove any existing entry with the same name.
llvm-svn: 94600
2010-01-26 22:03:41 +00:00
Chris Lattner
ee2b6b1cc5 emit jump table an alias ".set" directives through MCStreamer as
assignments.

.set x, a-b

is the same as:

x = a-b

llvm-svn: 94596
2010-01-26 21:53:08 +00:00
Chris Lattner
c2717878e8 fix CastInst::castIsValid to reject aggregate types, fixing PR6153:
llvm-as: t.ll:1:25: error: invalid cast opcode for cast from '[4 x i8]' to '[1 x i32]'
@x = constant [1 x i32] bitcast ([4 x i8] c"abcd" to [1 x i32])
                        ^

llvm-svn: 94595
2010-01-26 21:51:43 +00:00
Devang Patel
81ca658dae Remve unnecessary include.
llvm-svn: 94594
2010-01-26 21:42:58 +00:00
Devang Patel
4563d073d3 Use AssertingVH, just to be paranoid.
llvm-svn: 94593
2010-01-26 21:39:14 +00:00
Jakob Stoklund Olesen
1218f1331f Revert test polarity to match comment and desired outcome. Remove undeserved bonus.
A GEP with all constant indices is already considered free by
analyzeBasicBlock(), so don't give it an extra bonus in
CountCodeReductionForAlloca().

This patch should remove a small positive bias toward inlining functions with
variable-index GEPs, and remove a smaller negative bias from functions with
all-constant index GEPs.

llvm-svn: 94591
2010-01-26 21:31:35 +00:00
Jakob Stoklund Olesen
f4b32e1185 Remove dead code.
Functions containing indirectbr are marked NeverInline by analyzeBasicBlock(),
so there is no point in giving indirectbr special treatment in
CountCodeReductionForConstant. It is never called.

No functional change intended.

llvm-svn: 94590
2010-01-26 21:31:30 +00:00
Jakob Stoklund Olesen
509e8f1ec8 Skip calculation of ArgumentWeights if it will never be used.
Save a few bytes by allocating the correct size vector.

No functional change intended.

llvm-svn: 94589
2010-01-26 21:31:24 +00:00
Devang Patel
84b21559f8 Emit DW_AT_containing_type attribute for a class if containing type is known.
llvm-svn: 94587
2010-01-26 21:16:06 +00:00
Devang Patel
9e6549db1d Add extra element to composite type. This new element will be used to record c++ class that holds current class's vtable.
llvm-svn: 94586
2010-01-26 21:14:59 +00:00
Chris Lattner
325a36c358 Eliminate SetDirective, and replace it with HasSetDirective.
Default HasSetDirective to true, since most targets have it.

The targets that claim to not have it probably do, or it is
spelled differently. These include Blackfin, Mips, Alpha, and
PIC16.  All of these except pic16 are normal ELF targets, so
they almost certainly have it.

llvm-svn: 94585
2010-01-26 20:40:54 +00:00
Evan Cheng
54f23f1179 Delete dead code.
llvm-svn: 94583
2010-01-26 20:36:21 +00:00
Rafael Espindola
f46baf3304 Emit .comm alignment in bytes but .align in powers of 2 for ARM ELF.
Original patch by Sandeep Patel and updated by me.

llvm-svn: 94582
2010-01-26 20:21:43 +00:00
Chris Lattner
044439c9bc eliminate MCAsmInfo::NeedsSet: we now just use .set on any platform
that has it.

llvm-svn: 94581
2010-01-26 20:20:43 +00:00
Chris Lattner
9f98fa6707 don't set to the default value.
llvm-svn: 94580
2010-01-26 20:17:34 +00:00
Junjie Gu
cb8a5997e6 test commit.
llvm-svn: 94578
2010-01-26 19:45:17 +00:00
Dan Gohman
71fc5e8fce -disable-output is no longer needed with -analyze.
llvm-svn: 94574
2010-01-26 19:25:59 +00:00
Dan Gohman
4b3987001a Make the unsigned-range code more consistent with the signed-range code,
and clean up some loose ends.

llvm-svn: 94572
2010-01-26 19:19:05 +00:00