1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

21 Commits

Author SHA1 Message Date
Duncan Sands
1b33dd3c83 There are two ways of checking for a given type, for example isa<PointerType>(T)
and T->isPointerTy().  Convert most instances of the first form to the second form.
Requested by Chris.

llvm-svn: 96344
2010-02-16 11:11:14 +00:00
Jakob Stoklund Olesen
039cd8ab3a Update CodeMetrics to count 'big' function calls explicitly.
llvm-svn: 95453
2010-02-05 23:21:18 +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
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
Eric Christopher
9230a37bb0 Pad my commit stats by reducing indentation in this now separate
commit.

llvm-svn: 93473
2010-01-14 23:00:10 +00:00
Eric Christopher
013342ad23 Few minor changes that were requested. No functional change.
llvm-svn: 93462
2010-01-14 21:48:00 +00:00
Evan Cheng
595cdb7091 Small tweak to inline cost computation. Ext of i/fcmp results are mostly optimized away in codegen.
llvm-svn: 93453
2010-01-14 21:04:31 +00:00
Eric Christopher
b2708c4ba1 Reduce the inlining cost of functions that contain calls to easily,
and frequently optimized functions.

llvm-svn: 93448
2010-01-14 20:12:34 +00:00
Duncan Sands
fd3669403c Add a missing closing parenthesis, and tweak to fit in 80
columns.

llvm-svn: 85732
2009-11-01 19:12:43 +00:00
Chris Lattner
11944e39d4 add a comment about why we don't allow inlining indbr.
llvm-svn: 85724
2009-11-01 18:16:30 +00:00
Chris Lattner
7a60ef5e23 pull check for return inst out of loop, never inline a callee that contains
an indirectbr.

llvm-svn: 85702
2009-11-01 03:07:53 +00:00
Chris Lattner
2bc8002f4c rename indbr -> indirectbr to appease the residents of #llvm.
llvm-svn: 85351
2009-10-28 00:19:10 +00:00
Chris Lattner
665b9e2a3c Random updates to passes for indbr, I need blockaddress before I can do much more.
llvm-svn: 85316
2009-10-27 21:27:42 +00:00
Victor Hernandez
673c036bc7 Remove FreeInst.
Remove LowerAllocations pass.
Update some more passes to treate free calls just like they were treating FreeInst.

llvm-svn: 85176
2009-10-26 23:43:48 +00:00
Victor Hernandez
8428eb5720 Remove AllocationInst. Since MallocInst went away, AllocaInst is the only subclass of AllocationInst, so it no longer is necessary.
llvm-svn: 84969
2009-10-23 21:09:37 +00:00
Victor Hernandez
a25a2890fa Remove MallocInst from LLVM Instructions.
llvm-svn: 84299
2009-10-17 01:18:07 +00:00
Dan Gohman
c1e210fa10 Compute a full cost value even when a setjmp call is found.
llvm-svn: 84015
2009-10-13 20:10:10 +00:00
Dan Gohman
665e336185 Split code not specific to Function inlining out into a separate class,
named CodeMetrics. Move it to be a non-nested class. Rename RegionInfo
back to FunctionInfo.

llvm-svn: 84013
2009-10-13 19:58:07 +00:00
Dan Gohman
18cdd7ef1b Move the InlineCost code from Transforms/Utils to Analysis.
llvm-svn: 83998
2009-10-13 18:30:07 +00:00