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

56596 Commits

Author SHA1 Message Date
Dale Johannesen
4b9e510f8f Treat MO_REG 0 location as undefined in DEBUG_VALUE,
per document.

llvm-svn: 94693
2010-01-27 22:11:16 +00:00
Victor Hernandez
8bef667691 Need to recurse for all operands of function-local metadata; and handle Instructions (which map to themselves)
llvm-svn: 94691
2010-01-27 22:03:03 +00:00
Bob Wilson
2e1a609654 Avoid creating redundant PHIs in SSAUpdater::GetValueInMiddleOfBlock.
This was already being done in SSAUpdater::GetValueAtEndOfBlock so I've
just changed SSAUpdater to check for existing PHIs in both places.

llvm-svn: 94690
2010-01-27 22:01:02 +00:00
Ted Kremenek
7c93f74ed0 Update CMake build.
llvm-svn: 94687
2010-01-27 20:44:12 +00:00
Jeffrey Yasskin
fb10587e50 Kill ModuleProvider and ghost linkage by inverting the relationship between
Modules and ModuleProviders. Because the "ModuleProvider" simply materializes
GlobalValues now, and doesn't provide modules, it's renamed to
"GVMaterializer". Code that used to need a ModuleProvider to materialize
Functions can now materialize the Functions directly. Functions no longer use a
magic linkage to record that they're materializable; they simply ask the
GVMaterializer.

Because the C ABI must never change, we can't remove LLVMModuleProviderRef or
the functions that refer to it. Instead, because Module now exposes the same
functionality ModuleProvider used to, we store a Module* in any
LLVMModuleProviderRef and translate in the wrapper methods.  The bindings to
other languages still use the ModuleProvider concept.  It would probably be
worth some time to update them to follow the C++ more closely, but I don't
intend to do it.

Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735.

llvm-svn: 94686
2010-01-27 20:34:15 +00:00
Benjamin Kramer
cfe07fadc7 Don't bother with sprintf, just pass the Twine through.
llvm-svn: 94684
2010-01-27 19:58:47 +00:00
Benjamin Kramer
d408373dbe Use the less expensive getName function instead of getNameStr.
llvm-svn: 94683
2010-01-27 19:46:52 +00:00
Chandler Carruth
4b62a01a0c Quick fix to a test that is currently failing on every Linux build bot. No idea
if this is the "correct" fix, but it seems a strict improvement.

llvm-svn: 94675
2010-01-27 10:36:15 +00:00
Chandler Carruth
866dc92123 Silence GCC warnings with asserts turned off. No functionality change.
llvm-svn: 94673
2010-01-27 10:27:10 +00:00
Mikhail Glushenkov
5d02574734 Make SMDiagnostic::Print a const method.
llvm-svn: 94672
2010-01-27 10:13:28 +00:00
Mikhail Glushenkov
a5a618a417 Trailing whitespace.
llvm-svn: 94671
2010-01-27 10:13:11 +00:00
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