summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove includes of Support/Compiler.h that are no longer needed after theNick Lewycky2009-10-251-1/+0
| | | | | | VISIBILITY_HIDDEN removal. llvm-svn: 85043
* Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.Nick Lewycky2009-10-251-1/+1
| | | | | | | 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
* Malloc calls are marked NoAlias, so the code below the isMalloc() check ↵Victor Hernandez2009-10-191-2/+0
| | | | | | makes it redundant. Removing the isMalloc() check. llvm-svn: 84541
* Remove MallocInst from LLVM Instructions.Victor Hernandez2009-10-171-2/+1
| | | | llvm-svn: 84299
* remove special handling of bitcast(malloc), it will be handledChris Lattner2009-09-271-5/+4
| | | | | | when the loop inspects the bitcast operand. llvm-svn: 82928
* unlike the malloc instruction, "malloc" calls do not claim to be readonly, ↵Chris Lattner2009-09-271-1/+1
| | | | | | just nounwind. llvm-svn: 82927
* Enhance transform passes so that they apply the same tranforms to malloc ↵Victor Hernandez2009-09-181-3/+9
| | | | | | | | calls as to MallocInst. Reviewed by Dan Gohman. llvm-svn: 82300
* simplify some code by making the SCCNodes set contain Function*'sChris Lattner2009-08-311-12/+9
| | | | | | | | | | | | | | instead of CallGraphNode*'s. This also papers over a callgraph problem where a pass (in this case, MemCpyOpt) introduces a new function into the module (llvm.memset.i64) but doesn't add it to the call graph (nor should it, since it is a function pass). While it might be a good idea for MemCpyOpt to not synthesize functions in a runOnFunction(), there is no need for FunctionAttrs to be boneheaded, so fix it there. This fixes an assertion building 176.gcc. llvm-svn: 80535
* Fix some nasty callgraph dangling pointer problems in Chris Lattner2009-08-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | argpromotion and structretpromote. Basically, when replacing a function, they used the 'changeFunction' api which changes the entry in the function map (and steals/reuses the callgraph node). This has some interesting effects: first, the problem is that it doesn't update the "callee" edges in any callees of the function in the call graph. Second, this covers for a major problem in all the CGSCC pass stuff, which is that it is completely broken when functions are deleted if they *don't* reuse a CGN. (there is a cute little fixme about this though :). This patch changes the protocol that CGSCC passes must obey: now the CGSCC pass manager copies the SCC and preincrements its iterator to avoid passes invalidating it. This allows CGSCC passes to mutate the current SCC. However multiple passes may be run on that SCC, so if passes do this, they are now required to *update* the SCC to be current when they return. Other less interesting parts of this patch are that it makes passes update the CG more directly, eliminates changeFunction, and requires clients of replaceCallSite to specify the new callee CGN if they are changing it. llvm-svn: 80527
* Fix PR3754: don't mark functions that wrap MallocInst withDuncan Sands2009-05-061-0/+5
| | | | | | | | the readnone. Since MallocInst is scheduled for deletion it doesn't seem worth doing anything more subtle, such as having mayWriteToMemory return true for MallocInst. llvm-svn: 71077
* This debug info special case should no longerDuncan Sands2009-03-091-4/+0
| | | | | | | be needed now that these intrinsics are marked as not accessing memory. llvm-svn: 66420
* Fix comments, pointed out by Duncan Sands.Nick Lewycky2009-03-081-3/+3
| | | | llvm-svn: 66381
* Mark function returns as noalias.Nick Lewycky2009-03-081-0/+127
| | | | llvm-svn: 66369
* Ignore debug info intrinsics.Devang Patel2009-03-031-1/+5
| | | | llvm-svn: 65908
* BasicAliasAnalysis and FunctionAttrs were bothDuncan Sands2009-01-181-81/+2
| | | | | | | | | doing very similar pointer capture analysis. Factor out the common logic. The new version is from FunctionAttrs since it does a better job than the version in BasicAliasAnalysis llvm-svn: 62461
* Remove alloca tracking from nocapture analysis. Not onlyDuncan Sands2009-01-071-69/+16
| | | | | | | | | | was it not very helpful, it was also wrong! The problem is shown in the testcase: the alloca might be passed to a nocapture callee which dereferences it and returns the original pointer. But because it was a nocapture call we think we don't need to track its uses, but we do. llvm-svn: 61876
* Reorder these.Duncan Sands2009-01-071-24/+24
| | | | llvm-svn: 61873
* Use a switch rather than a sequence of "isa" tests.Duncan Sands2009-01-071-16/+32
| | | | llvm-svn: 61872
* Any void readonly functions are provably dead, don't waste time adding Nick Lewycky2009-01-031-14/+0
| | | | | | nocapture attributes to them. llvm-svn: 61610
* Load tracking means that the value analyzed mayDuncan Sands2009-01-021-2/+8
| | | | | | | | | | | | not have pointer type. In particular, it may be the condition argument for a select or a GEP index. While I was unable to construct a testcase for which some bits of the original pointer are captured due to one of these, it's very very close to being possible - so play safe and exclude these possibilities. llvm-svn: 61580
* When calculating 'nocapture' argument attributes, allowDuncan Sands2009-01-021-21/+60
| | | | | | | | | | | | the argument to be stored to an alloca by tracking uses of the alloca. This occurs 4 times (out of 7121, 0.05%) in MultiSource/Applications, so may not be worth it. On the other hand, it is easy to do and fairly cheap. The functions it helps are: W_addcom and W_addlit in spiff; process_args (argv) in d (make_dparser); ercPixConcealIMB in JM/ldecod. llvm-svn: 61570
* Improve comments and reorganize a bit - no functionalityDuncan Sands2009-01-021-56/+44
| | | | | | change. llvm-svn: 61569
* Make adding nocapture a bit stronger. FreeInst is nocapture. Also, Nick Lewycky2009-01-021-3/+27
| | | | | | | | | | functions that don't write can't leak a pointer except through the return value, so a void readonly function is implicitly nocapture. Test these, and add a test that verifies that f1 calling f2 with an otherwise dead pointer gets both of them marked nocapture. llvm-svn: 61552
* Mention that this pass does escape analysis in theDuncan Sands2009-01-011-3/+5
| | | | | | leading comments. llvm-svn: 61548
* Look through phi nodes and select instructions whenDuncan Sands2008-12-311-3/+8
| | | | | | calculating nocapture attributes. llvm-svn: 61535
* Don't analyze arguments already marked 'nocapture'.Duncan Sands2008-12-311-1/+2
| | | | llvm-svn: 61532
* Rename AddReadAttrs to FunctionAttrs, and teach it howDuncan Sands2008-12-311-0/+280
to work out (in a very simplistic way) which function arguments (pointer arguments only) are only dereferenced and so do not escape. Mark such arguments 'nocapture'. llvm-svn: 61525
OpenPOWER on IntegriCloud