1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-28 14:32:51 +01:00
Commit Graph

3897 Commits

Author SHA1 Message Date
Devang Patel
f749084aa3 Restore optimization that merges blocks when inline function
has single return value.

llvm-svn: 48162
2008-03-10 18:34:00 +00:00
Devang Patel
0df6cb288f Simplify
llvm-svn: 48161
2008-03-10 18:22:16 +00:00
Devang Patel
f81f0781cb simplify
llvm-svn: 48160
2008-03-10 18:11:41 +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
8626cfb86d SCCP also needs to be taught to follow unwind_to
llvm-svn: 48109
2008-03-09 09:44:38 +00:00
Nick Lewycky
1d6b50743f Don't eliminate blocks that are only reachable by unwind_to.
llvm-svn: 48106
2008-03-09 08:50:23 +00:00
Nick Lewycky
4732d3c9b7 Firstly, having a BranchInst isn't exclusive with having an unwind_to.
Secondly, we have to check whether the branch is actually pointing to the block
with the unwind in it. We could have gotten here because of the unwind_to alone.

llvm-svn: 48099
2008-03-09 07:50:37 +00:00
Nick Lewycky
e93a1819dc A BB that unwind_to an "unwind" inst is that same as one that doesn't unwind_to
at all.

llvm-svn: 48096
2008-03-09 07:36:38 +00:00
Nick Lewycky
50c8d20ca2 Update the block cloner which fixes bugpoint on code using unwind_to (phew!)
and also update the cloning interface's major user, the loop optimizations.

llvm-svn: 48088
2008-03-09 05:24:34 +00:00
Nick Lewycky
d98272094e Update the inliner and simplifycfg to handle unwind_to.
llvm-svn: 48086
2008-03-09 05:10:13 +00:00
Nick Lewycky
c64eb33c52 Two things. Preserve the unwind_to when splitting a BB.
Add the ability to remove just one instance of a BB from a phi node. This fixes
the compile error in the tree now.

llvm-svn: 48085
2008-03-09 05:04:48 +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
Nick Lewycky
e13db2c263 Not all users of a BB are Instructions any more.
llvm-svn: 48047
2008-03-08 07:48:41 +00:00
Devang Patel
9543238662 Update inliner to handle functions that return multiple values.
llvm-svn: 48020
2008-03-07 20:06: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
Gabor Greif
d746841e93 fix typos
llvm-svn: 47994
2008-03-06 10:36:00 +00:00
Nick Lewycky
f249c5d5ad Don't try to simplify urem and srem using arithmetic rules that don't work
under modulo (overflow). Fixes PR1933.

llvm-svn: 47987
2008-03-06 06:48:30 +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
e2c01a6c92 Handle 'ret' with multiple values.
llvm-svn: 47965
2008-03-05 21:50:24 +00:00
Devang Patel
4ca594a2d7 Skip functions that return multiple values.
llvm-svn: 47924
2008-03-05 00:36:59 +00:00
Devang Patel
844c248410 Use while loop.
llvm-svn: 47909
2008-03-04 21:59:49 +00:00
Devang Patel
84e9abbb60 Use cast instead of dyn_cast.
Update test to use multiple return value directly, instead of relying on -sretpromotion.

llvm-svn: 47907
2008-03-04 21:45:28 +00:00
Devang Patel
219be17d65 Filter nested structs
llvm-svn: 47906
2008-03-04 21:32:09 +00:00
Devang Patel
a14b91d6a3 Handle multiple return values.
llvm-svn: 47904
2008-03-04 21:15:15 +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
Chris Lattner
75f5d14574 fix a bug Anders ran into where scalarrepl would crash when promoting
a union containing a vector and an array whose elements were smaller than
the vector elements.  this means we need to compile the load of the 
array elements into an extract element plus a truncate.

llvm-svn: 47752
2008-02-29 07:12:06 +00:00
Chris Lattner
8f87e409b2 Refactor some code out of ConvertUsesToScalar into their own methods, no
functionality change.

llvm-svn: 47751
2008-02-29 07:03:13 +00:00
Chris Lattner
5aeccb7353 Folding or(fcmp,fcmp) only works if the operands of the fcmps are the same fp type.
llvm-svn: 47750
2008-02-29 06:09:11 +00:00
Owen Anderson
eadd074b22 Fix an issue where GVN had the sizes of the two memcpy's reverse, resulting
in an invalid transformation.

llvm-svn: 47639
2008-02-26 23:06:17 +00:00
Gabor Greif
2cb16cddf1 fix http://llvm.org/bugs/show_bug.cgi?id=2097
llvm-svn: 47615
2008-02-26 19:13:21 +00:00
Eli Friedman
1f2cabfbcf Fix for pr2093: direct operands aren't necessarily addresses, so don't
try to simplify them.

llvm-svn: 47610
2008-02-26 18:37:49 +00:00
Bill Wendling
bd1f1ae160 De-tabify.
llvm-svn: 47599
2008-02-26 10:53:30 +00:00
Evan Cheng
6366bbf577 Fix PR2076. CodeGenPrepare now sinks address computation for inline asm memory
operands into inline asm block.

llvm-svn: 47589
2008-02-26 02:42:37 +00:00
Owen Anderson
6eafd532ab Fix an issue where GVN was performing the return slot optimization when it was
not safe.  This is fixed by more aggressively checking that the return slot is
not used elsewhere in the function.

llvm-svn: 47544
2008-02-25 04:08:09 +00:00
Owen Anderson
432abc0479 Fix an issue where GVN would try to use an instruction before its definition when performing return slot optimization.
llvm-svn: 47541
2008-02-25 00:40:41 +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
Zhou Sheng
0742fbfedf Fixed a typo.
llvm-svn: 47478
2008-02-22 10:00:35 +00:00