Evan Cheng
8a61b02bd8
1. Drop default inline threshold back down to 200.
...
2. Do not use # of basic blocks as part of the cost computation since it doesn't really figure into function size.
3. More aggressively inline function with vector code.
llvm-svn: 49061
2008-04-01 23:59:29 +00:00
Evan Cheng
d01a2a18f8
Increasing the inline limit from (overly conservative) 200 to 300. Given each BB costs 20 and each instruction costs 5, 200 means a 4 BB function + 24 instructions (actually less because caller's size also contributes to it).
...
Furthermore, double the limit when more than 10% of the callee instructions are vector instructions. Multimedia kernels tend to love inlining.
llvm-svn: 48725
2008-03-24 06:37:48 +00:00
Dan Gohman
a363ba510c
Don't include <map> in Pass.h, which doesn't need it. This requires
...
adding <map> to many files that actually do need it.
llvm-svn: 48667
2008-03-21 23:51:57 +00:00
Andrew Lenharth
2ff2bcbde8
FunctionExtractorPass has been superceded by GVExtractorPass
...
llvm-svn: 48648
2008-03-21 16:46:53 +00:00
Devang Patel
192124d0e6
Incorporate feedback.
...
- Fix loop nest.
- Use RetVals.size()
- Check for null return value.
llvm-svn: 48605
2008-03-20 18:30:32 +00:00
Zhou Sheng
fc7856f528
Take the old function's name.
...
llvm-svn: 48588
2008-03-20 08:05:05 +00:00
Chris Lattner
7925cc72c0
Reimplement the parameter attributes support, phase #1 . hilights:
...
1. There is now a "PAListPtr" class, which is a smart pointer around
the underlying uniqued parameter attribute list object, and manages
its refcount. It is now impossible to mess up the refcount.
2. PAListPtr is now the main interface to the underlying object, and
the underlying object is now completely opaque.
3. Implementation details like SmallVector and FoldingSet are now no
longer part of the interface.
4. You can create a PAListPtr with an arbitrary sequence of
ParamAttrsWithIndex's, no need to make a SmallVector of a specific
size (you can just use an array or scalar or vector if you wish).
5. All the client code that had to check for a null pointer before
dereferencing the pointer is simplified to just access the
PAListPtr directly.
6. The interfaces for adding attrs to a list and removing them is a
bit simpler.
Phase #2 will rename some stuff (e.g. PAListPtr) and do other less
invasive changes.
llvm-svn: 48289
2008-03-12 17:45:29 +00:00
Devang Patel
0b10747ac8
Check multiple return values.
...
llvm-svn: 48267
2008-03-12 00:32:32 +00:00
Devang Patel
9e4d8236fc
Fix attribute handling.
...
llvm-svn: 48262
2008-03-12 00:07:03 +00:00
Devang Patel
54b2c77a4e
Handle multiple ret values.
...
llvm-svn: 48254
2008-03-11 22:24:29 +00:00
Devang Patel
0fbeba7276
Initialize.
...
llvm-svn: 48253
2008-03-11 22:08:21 +00:00
Nick Lewycky
5dd879d5b5
Turn unwind_to into "unwinds to".
...
llvm-svn: 48123
2008-03-10 02:20:00 +00:00
Ted Kremenek
b05e945be4
Fix some compilation errors on msvc:
...
- "Redefinition of I" (iterator masks previous definition)
- include missing header file
Patch by Argiris Kirtzidis!
llvm-svn: 48115
2008-03-09 18:32:50 +00:00
Nick Lewycky
efac6a28b4
And again.
...
llvm-svn: 48112
2008-03-09 17:13:05 +00:00
Nick Lewycky
dd4885aa80
Braces belong here. No functionality change.
...
llvm-svn: 48111
2008-03-09 17:11:18 +00:00
Nick Lewycky
980738baf2
Prune the unwind_to labels on BBs that don't need them. Another step in the
...
removal of invoke, PR1269.
llvm-svn: 48084
2008-03-09 04:55:16 +00:00
Andrew Lenharth
6c788376e9
add a pass that can extract all kinds of global values, not just functions. Update llvm-extract to use it and optionally extract a global variable if you want it too
...
llvm-svn: 48015
2008-03-07 19:51:57 +00:00
Devang Patel
63e7d0fe7d
Skip, for now, callsites where use of sret argument is not dominated by callsite.
...
llvm-svn: 47980
2008-03-05 23:39:23 +00:00
Devang Patel
219be17d65
Filter nested structs
...
llvm-svn: 47906
2008-03-04 21:32:09 +00:00
Devang Patel
1e76b493c7
Use appropriate index to get the result value.
...
llvm-svn: 47897
2008-03-04 19:22:54 +00:00
Devang Patel
9eb2e291fb
Skip sret attribute while preparing attribute list for
...
new function and new call sites.
llvm-svn: 47896
2008-03-04 19:12:58 +00:00
Devang Patel
a880f004e8
Increment counter that keeps track of total number of sret promoted.
...
llvm-svn: 47892
2008-03-04 17:48:11 +00:00
Devang Patel
aef77854f9
Skip declarations.
...
llvm-svn: 47890
2008-03-04 17:47:06 +00:00
Devang Patel
e33efc5c23
Process externally visible functions also. Later on code generator will do the right thing.
...
llvm-svn: 47889
2008-03-04 17:46:26 +00:00
Devang Patel
10d720e1ba
Collect statistics.
...
llvm-svn: 47888
2008-03-04 17:44:37 +00:00
Devang Patel
d0d7028a2b
s/isReturnStruct()/hasStructRetAttr()/g
...
llvm-svn: 47857
2008-03-03 21:46:28 +00:00
Devang Patel
f7259bfa0b
Preserve paramater attributes.
...
llvm-svn: 47847
2008-03-03 18:36:03 +00:00
Chris Lattner
1e21cae4cd
allow specified inline threshold to be negative, as the value is
...
itself sometimes negative.
llvm-svn: 47786
2008-03-01 08:09:51 +00:00
Devang Patel
79236a7c7a
Fix cut-n-pasto.
...
llvm-svn: 47777
2008-02-29 23:41:13 +00:00
Devang Patel
cb72d92471
Add pass to promote sret.
...
This pass transforms
%struct._Point = type { i32, i32, i32, i32, i32, i32 }
define internal void @foo(%struct._Point* sret %agg.result)
into
%struct._Point = type { i32, i32, i32, i32, i32, i32 }
define internal %struct._Point @foo()
This pass updates foo() clients appropriately to use
getresult instruction to extract return values.
This pass is not yet ready for prime time.
llvm-svn: 47776
2008-02-29 23:34:08 +00:00
Dale Johannesen
ae08bdb4cf
Split ParameterAttributes.h, putting the complicated
...
stuff into ParamAttrsList.h. Per feedback from
ParamAttrs changes.
llvm-svn: 47504
2008-02-22 22:17:59 +00:00
Anton Korobeynikov
2523c8be38
Get rid of hash_map. Use StringMap instead
...
llvm-svn: 47373
2008-02-20 11:27:49 +00:00
Anton Korobeynikov
fd6b669c80
Make Transforms to be 4.3 warnings-clean
...
llvm-svn: 47371
2008-02-20 11:26:25 +00:00
Anton Korobeynikov
0c5e186924
Unbreak build with gcc 4.3: provide missed includes and silence most annoying warnings.
...
llvm-svn: 47367
2008-02-20 11:08:44 +00:00
Dale Johannesen
ecb2b233b1
Expand ParameterAttributes to 32 bits (in preparation
...
for adding alignment info, not there yet). Clean up
interfaces to reference ParameterAttributes consistently.
llvm-svn: 47342
2008-02-19 21:38:47 +00:00
Duncan Sands
a85448506d
Simplify caller updating using a CallSite, as
...
requested by Chris. While there, do the same
for an existing function committed by someone
called "lattner" :)
llvm-svn: 47273
2008-02-18 17:32:13 +00:00
Duncan Sands
cd0325cce1
Remove any 'nest' parameter attributes if the function
...
is not passed as an argument to a trampoline intrinsic.
llvm-svn: 47220
2008-02-16 20:56:04 +00:00
Chris Lattner
c16c85444c
remove some dead code.
...
llvm-svn: 47066
2008-02-13 17:18:26 +00:00
Duncan Sands
454a8eaee9
Don't drop function/call return attributes like 'nounwind'.
...
llvm-svn: 46645
2008-02-01 20:37:16 +00:00
Chris Lattner
e08ec140e0
Don't let globalopt hack on volatile loads or stores.
...
llvm-svn: 46523
2008-01-29 19:01:37 +00:00
Dan Gohman
aad233ea10
Use empty() instead of comparing size() with zero.
...
llvm-svn: 46514
2008-01-29 13:02:09 +00:00
Chris Lattner
dc0c4352bd
Transform calls to memcpy into llvm.memcpy calls, patch by Eli Friedman.
...
llvm-svn: 46433
2008-01-28 04:41:43 +00:00
Evan Cheng
c187163bab
DAE bug fix. Don't lose parameter attributes on vararg arguments.
...
llvm-svn: 46113
2008-01-17 04:18:54 +00:00
Chris Lattner
c32be7e6b2
Fix arg promotion to propagate the correct attrs on the calls to
...
promoted functions. This is important for varargs calls in
particular. Thanks to duncan for providing a great testcase.
llvm-svn: 46108
2008-01-17 01:17:03 +00:00
Chris Lattner
81a39bb7ba
Handle attribute(used) global variables that are i8.
...
llvm-svn: 46090
2008-01-16 21:35:43 +00:00
Devang Patel
a8d63b0b30
Do not strip llvm.used values.
...
llvm-svn: 46045
2008-01-16 03:33:05 +00:00
Chris Lattner
efb498eddb
Fix the miscompilation of MiBench/consumer-lame that was exposed by Evan's
...
byval work. This miscompilation is due to the program indexing an array out
of range and us doing a transformation that broke this.
llvm-svn: 45949
2008-01-14 02:09:12 +00:00
Chris Lattner
5d135cc20a
The isNotSuitableForSRA property is now dead, don't compute it.
...
llvm-svn: 45948
2008-01-14 01:32:52 +00:00
Chris Lattner
760b05a331
Change SRAGlobal to not depend on isNotSuitableForSRA, which makes it very
...
difficult to understand the invariants.
llvm-svn: 45947
2008-01-14 01:31:05 +00:00
Chris Lattner
c2933482a0
Make the 'shrink global to bool' optimization more self contained, and thus
...
easier to show that its safe. No functionality change.
llvm-svn: 45946
2008-01-14 01:17:44 +00:00