summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/FunctionAttrs
Commit message (Collapse)AuthorAgeFilesLines
* Fix a README item: have functionattrs look through selects andDuncan Sands2010-01-061-2/+27
| | | | | | | | | phi nodes when deciding which pointers point to local memory. I actually checked long ago how useful this is, and it isn't very: it hardly ever fires in the testsuite, but since Chris wants it here it is! llvm-svn: 92836
* Partially address a README by having functionattrs consider calls toDuncan Sands2010-01-061-2/+31
| | | | | | | | | | memcpy, memset and other intrinsics that only access their arguments to be readnone if the intrinsic's arguments all point to local memory. This improves the testcase in the README to readonly, but it could in theory be made readnone, however this would involve more sophisticated analysis that looks through the memcpy. llvm-svn: 92829
* Change tests from "opt %s" to "opt < %s" so that opt doesn't see theDan Gohman2009-09-119-11/+11
| | | | | | | | input filename so that opt doesn't print the input filename in the output so that grep lines in the tests don't unintentionally match strings in the input filename. llvm-svn: 81537
* Use opt -S instead of piping bitcode output through llvm-dis.Dan Gohman2009-09-089-11/+11
| | | | llvm-svn: 81257
* Change these tests to feed the assembly files to opt directly, insteadDan Gohman2009-09-089-11/+11
| | | | | | of using llvm-as, now that opt supports this. llvm-svn: 81226
* Revert r70876 and add a testcase (@c7) showing the problem:Duncan Sands2009-05-071-9/+18
| | | | | | | | | | | bits captured, but the pointer marked nocapture. In fact I now recall that this problem is why only readnone functions returning void were considered before! However keep a small fix that was also in r70876: a readnone function returning void can result in bits being captured if it unwinds, so test for this. llvm-svn: 71168
* Fix PR3754: don't mark functions that wrap MallocInst withDuncan Sands2009-05-061-0/+7
| | | | | | | | 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
* Teach capture tracking that readonly functions canDuncan Sands2009-05-041-4/+20
| | | | | | | | only capture their arguments by returning them or throwing an exception or not based on the argument value. Patch essentially by Frits van Bommel. llvm-svn: 70876
* Remove alloca tracking from nocapture analysis. Not onlyDuncan Sands2009-01-071-18/+9
| | | | | | | | | | 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
* When calculating 'nocapture' argument attributes, allowDuncan Sands2009-01-021-0/+23
| | | | | | | | | | | | 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
* Remove the cyclic part of this test, it was passing for the wrong Nick Lewycky2009-01-021-11/+1
| | | | | | | reason. Two functions which mutually require each other to be nocapture are not currently supported. llvm-svn: 61553
* Make adding nocapture a bit stronger. FreeInst is nocapture. Also, Nick Lewycky2009-01-021-1/+23
| | | | | | | | | | 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
* Add tests for two types of traps that escape analysisDuncan Sands2009-01-021-0/+23
| | | | | | might one day fall into. llvm-svn: 61549
* Look through phi nodes and select instructions whenDuncan Sands2008-12-311-15/+22
| | | | | | calculating nocapture attributes. llvm-svn: 61535
* Rename AddReadAttrs to FunctionAttrs, and teach it howDuncan Sands2008-12-318-0/+102
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