summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/FunctionAttrs
Commit message (Collapse)AuthorAgeFilesLines
* When analyzing params/args for readnone/readonly, don't forget to consider ↵Nick Lewycky2014-05-302-1/+15
| | | | | | that a pointer argument may be passed through a callsite to the return, and that we may need to analyze it. Fixes a bug reported on llvm-dev: http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-May/073098.html llvm-svn: 209870
* Update optimization passes to handle inalloca argumentsReid Kleckner2014-01-281-0/+6
| | | | | | | | | | | | | | | Summary: I searched Transforms/ and Analysis/ for 'ByVal' and updated those call sites to check for inalloca if appropriate. I added tests for any change that would allow an optimization to fire on inalloca. Reviewers: nlewycky Differential Revision: http://llvm-reviews.chandlerc.com/D2449 llvm-svn: 200281
* Make nocapture analysis work with addrspacecastMatt Arsenault2014-01-141-0/+15
| | | | llvm-svn: 199246
* [tests] Cleanup initialization of test suffixes.Daniel Dunbar2013-08-161-1/+0
| | | | | | | | | | | | | | | | | - Instead of setting the suffixes in a bunch of places, just set one master list in the top-level config. We now only modify the suffix list in a few suites that have one particular unique suffix (.ml, .mc, .yaml, .td, .py). - Aside from removing the need for a bunch of lit.local.cfg files, this enables 4 tests that were inadvertently being skipped (one in Transforms/BranchFolding, a .s file each in DebugInfo/AArch64 and CodeGen/PowerPC, and one in CodeGen/SI which is now failing and has been XFAILED). - This commit also fixes a bunch of config files to use config.root instead of older copy-pasted code. llvm-svn: 188513
* Fix FileCheck --check-prefix lines.Tim Northover2013-08-121-1/+1
| | | | | | | | | | Various tests had sprung up over the years which had --check-prefix=ABC on the RUN line, but "CHECK-ABC:" later on. This happened to work before, but was strictly incorrect. FileCheck is getting stricter soon though. Patch by Ron Ofir. llvm-svn: 188173
* Update Transforms tests to use CHECK-LABEL for easier debugging. No ↵Stephen Lin2013-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | functionality change. This update was done with the following bash script: find test/Transforms -name "*.ll" | \ while read NAME; do echo "$NAME" if ! grep -q "^; *RUN: *llc" $NAME; then TEMP=`mktemp -t temp` cp $NAME $TEMP sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \ while read FUNC; do sed -i '' "s/;\(.*\)\([A-Za-z0-9_]*\):\( *\)@$FUNC\([( ]*\)\$/;\1\2-LABEL:\3@$FUNC(/g" $TEMP done mv $TEMP $NAME fi done llvm-svn: 186268
* Extend 'readonly' and 'readnone' to work on function arguments as well asNick Lewycky2013-07-066-14/+72
| | | | | | | functions. Make the function attributes pass add it to known library functions and when it can deduce it. llvm-svn: 185735
* Change the gettimeofday test to only test on a posix platform.Michael Gottesman2013-07-031-1/+3
| | | | llvm-svn: 185503
* Added support in FunctionAttrs for adding relevant function/argument ↵Michael Gottesman2013-07-031-0/+3
| | | | | | | | | | attributes for the posix call gettimeofday. This implies annotating it as nounwind and its arguments as nocapture. To be conservative, we do not annotate the arguments with noalias since some platforms do not have restrict on the declaration for gettimeofday. llvm-svn: 185502
* Move library call prototype attribute inference to functionattrsMeador Inge2013-03-212-0/+39
| | | | | | | | | | | | The simplify-libcalls pass implemented a doInitialization hook to infer function prototype attributes for well-known functions. Given that the simplify-libcalls pass is going away *and* that the functionattrs pass is already in place to deduce function attributes, I am moving this logic to the functionattrs pass. This approach was discussed during patch review: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121126/157465.html. llvm-svn: 177619
* Modify the LLVM assembly output so that it uses references to represent ↵Bill Wendling2013-02-203-8/+14
| | | | | | | | | | | function attributes. This makes the LLVM assembly look better. E.g.: define void @foo() #0 { ret void } attributes #0 = { nounwind noinline ssp } llvm-svn: 175605
* Fix a bug in mayHaveSideEffects. Functions that do not return are now ↵Nadav Rotem2013-02-191-0/+18
| | | | | | | | considered as instructions with side effects. rdar://13227456 llvm-svn: 175553
* FileCheck-ize the tests.Bill Wendling2013-02-112-4/+10
| | | | llvm-svn: 174865
* Convert getAttributes() to return an AttributeSetNode.Bill Wendling2013-01-291-2/+2
| | | | | | | The AttributeSetNode contains all of the attributes. This removes one (hopefully last) use of the Attribute class as a container of multiple attributes. llvm-svn: 173761
* Convert all tests using TCL-style quoting to use shell-style quoting.Chandler Carruth2012-07-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | This was done through the aid of a terrible Perl creation. I will not paste any of the horrors here. Suffice to say, it require multiple staged rounds of replacements, state carried between, and a few nested-construct-parsing hacks that I'm not proud of. It happens, by luck, to be able to deal with all the TCL-quoting patterns in evidence in the LLVM test suite. If anyone is maintaining large out-of-tree test trees, feel free to poke me and I'll send you the steps I used to convert things, as well as answer any painful questions etc. IRC works best for this type of thing I find. Once converted, switch the LLVM lit config to use ShTests the same as Clang. In addition to being able to delete large amounts of Python code from 'lit', this will also simplify the entire test suite and some of lit's architecture. Finally, the test suite runs 33% faster on Linux now. ;] For my 16-hardware-thread (2x 4-core xeon e5520): 36s -> 24s llvm-svn: 159525
* Replace all instances of dg.exp file with lit.local.cfg, since all tests are ↵Eli Bendersky2012-02-162-3/+1
| | | | | | | | run with LIT now and now Dejagnu. dg.exp is no longer needed. Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches. llvm-svn: 150664
* Change CaptureTracking to pass a Use* instead of a Value* when a value isNick Lewycky2011-12-281-0/+61
| | | | | | | | | | | | | | captured. This allows the tracker to look at the specific use, which may be especially interesting for function calls. Use this to fix 'nocapture' deduction in FunctionAttrs. The existing one does not iterate until a fixpoint and does not guarantee that it produces the same result regardless of iteration order. The new implementation builds up a graph of how arguments are passed from function to function, and uses a bottom-up walk on the argument-SCCs to assign nocapture. This gets us nocapture more often, and does so rather efficiently and independent of iteration order. llvm-svn: 147327
* Move this test from date-name to feature-name, and port it to FileCheck.Nick Lewycky2011-12-231-2/+14
| | | | llvm-svn: 147223
* Upgrade syntax of tests using volatile instructions to use 'load volatile' ↵Chris Lattner2011-11-272-2/+2
| | | | | | instead of 'volatile load', which is archaic. llvm-svn: 145171
* Update some tests to the new EH scheme.Bill Wendling2011-09-011-0/+4
| | | | llvm-svn: 138925
* Fix test.Eli Friedman2011-08-161-1/+1
| | | | llvm-svn: 137703
* Revert a bit of r137667; the logic in question can safely handle atomic ↵Eli Friedman2011-08-161-0/+21
| | | | | | load/store. llvm-svn: 137702
* rip out a ton of intrinsic modernization logic from AutoUpgrade.cpp, which isChris Lattner2011-06-181-64/+0
| | | | | | | | | for pre-2.9 bitcode files. We keep x86 unaligned loads, movnt, crc32, and the target indep prefetch change. As usual, updating the testsuite is a PITA. llvm-svn: 133337
* manually upgrade a bunch of tests to modern syntax, and remove some thatChris Lattner2011-06-171-7/+0
| | | | | | are either unreduced or only test old syntax. llvm-svn: 133228
* Make ModRefBehavior a lattice. Use this to clean up AliasAnalysisDan Gohman2010-11-102-2/+2
| | | | | | chaining and simplify FunctionAttrs' GetModRefBehavior logic. llvm-svn: 118660
* Extend the AliasAnalysis::pointsToConstantMemory interface to allow itDan Gohman2010-11-081-1/+1
| | | | | | | | | | | | to optionally look for constant or local (alloca) memory. Teach BasicAliasAnalysis::pointsToConstantMemory to look through Select and Phi nodes, and to support looking for local memory. Remove FunctionAttrs' PointsToLocalOrConstantMemory function, now that AliasAnalysis knows all the tricks that it knew. llvm-svn: 118412
* Make FunctionAttrs use AliasAnalysis::getModRefBehavior, now that itDan Gohman2010-11-081-1/+1
| | | | | | knows about intrinsic functions. llvm-svn: 118410
* If a function does a volatile load from a global constant, do notDuncan Sands2010-10-301-0/+10
| | | | | | | | | consider it to be readonly. In fact, don't even consider it to be readonly if it does a volatile load from an AllocaInst either (it is debatable as to whether readonly would be correct or not in this case; play safe for the moment). This fixes PR8279. llvm-svn: 117783
* 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