1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

58 Commits

Author SHA1 Message Date
Nick Lewycky
711c726c97 Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.
Chris claims we should never have visibility_hidden inside any .cpp file but
that's still not true even after this commit.

llvm-svn: 85042
2009-10-25 06:33:48 +00:00
Torok Edwin
193d22fa77 Constant propagating byval pointer is safe if function is readonly.
llvm-svn: 82700
2009-09-24 18:33:42 +00:00
Torok Edwin
81fe296f15 Don't constant propagate byval pointers, since they are not really pointers, but
rather structs passed by value.
This fixes PR5038.

llvm-svn: 82689
2009-09-24 09:47:18 +00:00
Owen Anderson
9df206d02d Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Owen Anderson
93ccaf5c60 Move more code back to 2.5 APIs.
llvm-svn: 77635
2009-07-30 23:03:37 +00:00
Owen Anderson
cc287b28c9 Get rid of the Pass+Context magic.
llvm-svn: 76702
2009-07-22 00:24:57 +00:00
Owen Anderson
21d2d69727 Move the ConstantInt uniquing table into LLVMContextImpl. This exposed a number of issues in
our current context-passing stuff, which is also fixed here

llvm-svn: 76089
2009-07-16 18:04:31 +00:00
Owen Anderson
5f268720e9 Finish LLVMContext-ing lib/Analysis. This required pushing LLVMContext's through the ValueTracking API.
llvm-svn: 74873
2009-07-06 22:37:39 +00:00
Owen Anderson
4eb0f1a3bd More LLVMContext-ification.
llvm-svn: 74811
2009-07-06 01:34:54 +00:00
Jay Foad
a442a46de9 Use cast<> instead of dyn_cast<> for things that are known to be
Instructions.

llvm-svn: 73002
2009-06-06 17:49:35 +00:00
Gabor Greif
d56b0a8c03 introduce a useful abstraction to find out if a Use is in the call position of an instruction
llvm-svn: 62788
2009-01-22 21:35:57 +00:00
Rafael Espindola
0aba6c9435 Add the private linkage.
llvm-svn: 62279
2009-01-15 20:18:42 +00:00
Dan Gohman
700611dfc6 Clean up some multiple-return-value code that is no longer
applicable.

llvm-svn: 57033
2008-10-03 22:21:24 +00:00
Nuno Lopes
a4d69747c1 remove redundant test (mayBeOverriden() includes hasLinkOnceLinkage)
llvm-svn: 56786
2008-09-29 14:40:32 +00:00
Duncan Sands
651eeb4be2 Rename isWeakForLinker to mayBeOverridden. Use it
instead of hasWeakLinkage in a bunch of optimization
passes.

llvm-svn: 56782
2008-09-29 11:25:42 +00:00
Dan Gohman
e1f9be27bc Tidy up several unbeseeming casts from pointer to intptr_t.
llvm-svn: 55779
2008-09-04 17:05:41 +00:00
Dan Gohman
6564581be0 Enable first-class aggregates support.
Remove the GetResultInst instruction. It is still accepted in LLVM assembly
and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove
support for return instructions with multiple values. These are auto-upgraded
to use InsertValueInst instructions.

The IRBuilder still accepts multiple-value returns, and auto-upgrades them
to InsertValueInst instructions.

llvm-svn: 53941
2008-07-23 00:34:11 +00:00
Matthijs Kooijman
41c5b9a77c Use a CallSite to find the nth argument of a call/invoke instruction instead of
using getOperand() directly. This makes things work with invoke instructions as
well.

llvm-svn: 52489
2008-06-19 08:53:24 +00:00
Matthijs Kooijman
8177832230 Reapply r52397 (make IPConstProp promote returned arguments), but fixed this
time. Sorry for the trouble!

This time, also add a testcase, which I should have done in the first place...

llvm-svn: 52455
2008-06-18 08:30:37 +00:00
Matthijs Kooijman
bb59138fa6 Reapply r52396, it was unrelated to the breakage (that was caused by r52397, my
commit after this).

llvm-svn: 52453
2008-06-18 08:09:27 +00:00
Chris Lattner
4be2e72cc5 revert recent patch which is causing widespread breakage.
llvm-svn: 52415
2008-06-17 17:06:43 +00:00
Matthijs Kooijman
dd32cb58b5 Learn IPConstProp to propagate arguments that are directly returned. Strictly
speaking these are not constant values. However, when a function always returns
one of its arguments, then from the point of view of each caller the return
value is constant (or at least a known value) and can be replaced.

llvm-svn: 52397
2008-06-17 12:20:24 +00:00
Matthijs Kooijman
f0adaf34a1 Learn IPConstProp to look at individual return values and propagate them
individually.

Also learn IPConstProp how returning first class aggregates work, in addition
to old style multiple return instructions.

Modify the return-constants testscase to confirm this behaviour.

llvm-svn: 52396
2008-06-17 12:02:52 +00:00
Chris Lattner
7864575654 Fix PR2411, where ip constant prop would propagate the
result of a weak function.

llvm-svn: 52137
2008-06-09 07:58:07 +00:00
Dan Gohman
bab18cae46 Clean up the use of static and anonymous namespaces. This turned up
several things that were neither in an anonymous namespace nor static
but not intended to be global.

llvm-svn: 51017
2008-05-13 00:00:25 +00:00
Chris Lattner
bc79442313 simplify code for propagation of constant arguments into
callees.

llvm-svn: 50142
2008-04-23 06:16:27 +00:00
Chris Lattner
408b51d214 Fix a number of bugs in ipconstantprop, simplify the code, fit in 80 cols,
fix read after free bug (PR2238).

llvm-svn: 50141
2008-04-23 05:59:23 +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
Devang Patel
54b2c77a4e Handle multiple ret values.
llvm-svn: 48254
2008-03-11 22:24:29 +00:00
Anton Korobeynikov
fd6b669c80 Make Transforms to be 4.3 warnings-clean
llvm-svn: 47371
2008-02-20 11:26:25 +00:00
Chris Lattner
ad9a6ccb83 Remove attribution from file headers, per discussion on llvmdev.
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Nick Lewycky
c2306ff5b4 Fix typo in comment.
llvm-svn: 36873
2007-05-06 13:37:16 +00:00
Devang Patel
cd45427a87 Drop 'const'
llvm-svn: 36662
2007-05-03 01:11:54 +00:00
Devang Patel
8ee9065162 Use 'static const char' instead of 'static const int'.
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.

llvm-svn: 36652
2007-05-02 21:39:20 +00:00
Devang Patel
38a66bc82e Do not use typeinfo to identify pass in pass manager.
llvm-svn: 36632
2007-05-01 21:15:47 +00:00
Reid Spencer
8749d297f5 Apply the VISIBILITY_HIDDEN field to the remaining anonymous classes in
the Transforms library. This reduces debug library size by 132 KB, debug
binary size by 376 KB, and reduces link time for llvm tools slightly.

llvm-svn: 33939
2007-02-05 23:32:05 +00:00
Reid Spencer
19af04a142 For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.

llvm-svn: 33663
2007-01-30 20:08:39 +00:00
Chris Lattner
44723daefa Eliminate static ctors due to Statistic objects
llvm-svn: 32693
2006-12-19 22:09:18 +00:00
Chris Lattner
a531ce882e Detemplatize the Statistic class. The only type it is instantiated with
is 'unsigned'.

llvm-svn: 32279
2006-12-06 17:46:33 +00:00
Chris Lattner
a39dcb5377 eliminate RegisterOpt. It does the same thing as RegisterPass.
llvm-svn: 29925
2006-08-27 22:42:52 +00:00
Misha Brukman
53e199440e Remove trailing whitespace
llvm-svn: 21427
2005-04-21 23:48:37 +00:00
Chris Lattner
4b688a1c70 This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!

llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Chris Lattner
59ce936426 Only cound if we actually made a change.
llvm-svn: 18800
2004-12-11 17:00:14 +00:00
Chris Lattner
d6d9a04344 Remove note to self
llvm-svn: 17734
2004-11-14 06:57:47 +00:00
Chris Lattner
363e78c357 If a function always returns a constant, replace all calls sites with that
constant value.  This makes the return value dead and allows for
simplification in the caller.

This implements IPConstantProp/return-constant.ll

This triggers several dozen times throughout SPEC.

llvm-svn: 17730
2004-11-14 06:10:11 +00:00
Chris Lattner
1a469385bd Actually, leave the check in. This prevents us from counting dead arguments
as IPCP opportunities.

llvm-svn: 17680
2004-11-11 07:47:54 +00:00
Chris Lattner
dba9c2b0ef Fix bug: IPConstantProp/deadarg.ll
llvm-svn: 17679
2004-11-11 07:46:29 +00:00
Chris Lattner
d920b5b770 Make IP Constant prop more aggressive about handling self recursive calls.
This implements IPConstantProp/recursion.ll

llvm-svn: 17666
2004-11-10 19:43:59 +00:00
Chris Lattner
b214a04a16 Do not let dead constant expressions hanging off of functions prevent IPCP.
This allows to elimination of a bunch of global pool descriptor args from
programs being pool allocated (and is also generally useful!)

llvm-svn: 17657
2004-11-09 20:47:30 +00:00
Chris Lattner
43c0372c0b 'Pass' should now not be derived from by clients. Instead, they should derive
from ModulePass.  Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.

llvm-svn: 16436
2004-09-20 04:48:05 +00:00