summaryrefslogtreecommitdiff
path: root/utils/update_llc_test_checks.py
AgeCommit message (Collapse)Author
2017-12-01Add more triples to llc_test_checks.pySam Parker
Added some commonly used Arm triples to the script, with and without the -eabi suffix. Differential Revision: https://reviews.llvm.org/D40708 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319545 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-26[utils][mips] Add support for mips for update_llc_checks.pySimon Dardis
Add support for mips, particularly skipping the matching of .frame, .(f)mask and LLVM's usage of the .set no(reorder|at|macro) directives. Reviewers: spatel Differential Revision: https://reviews.llvm.org/D40268 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319001 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[utils] Fix RISC-V support in update_llc_test_checks.pyAlex Bradbury
scrub_asm_riscv now takes two arguments rather than one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317826 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08[utils] Add RISC-V support to update_llc_test_checks.pyAlex Bradbury
This should be a trivial change, and I've started using it for generating all tests at https://github.com/lowrisc/riscv-llvm (i.e. it's been tested in action quite a lot). Note that the regex does not attempt to match .cfi_startproc, as I want to ensure compatibility with functions that have the nounwind attribute. Differential Revision: https://reviews.llvm.org/D39789 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317693 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-24[utils] make retq/retl regex an option that is off by defaultSanjay Patel
Ideally, we should compare 32- and 64-bit versions to see if the ret line is the only difference and then insert the regex only in that case. But this is a quick hack to avoid a bunch of noise as existing tests are updated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316443 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-22[utils] Support -mtriple=powerpc64Fangrui Song
Summary: test/CodeGen/PowerPC/pr33093.ll uses both powerpc64 (big-endian) and powerpc64le while the former was unsupported. Subscribers: nemanjai Differential Revision: https://reviews.llvm.org/D39164 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316297 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-20[utils, x86] add regex for retl/retq to reduce duplicated FileChecking (PR35003)Sanjay Patel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316242 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-06Util: Improve update_llc_test_checks to scrub macosx-style assembly annotationsZvi Rackover
Summary: In D37523 Sanjay pointed out that the tool does not scrub macosx-style 'End of Function' annotations, where the comments begin with a double-#. I tested this patch by verifying all existing occurences of 'End function' are scrubbed: find ./test/CodeGen/X86 -name '*.ll' | xargs grep -l "End function" | xargs utils/update_llc_test_checks.py --llc-binary build/bin/llc Reviewers: spatel, chandlerc, craig.topper Reviewed By: spatel Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D37532 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312678 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-25[utils] add aarch64 target as an optionSanjay Patel
I don't know enough to add a custom scrubber for AArch64, so I just re-used ARM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311795 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-25Teach the llc check updater to recognize the end-of-function commentChandler Carruth
used on Windows and sometimes Darwin. Cleans up generated patterns for me quite a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311752 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28Fix update_llc_test_checks.py ARM parsingEli Friedman
When I tried running the script, the ARM regex parser could not parse my code. It failed because the .Lfunc_end line has a comment at the end of it, so this commit removes the newline at the end of the regex. Patch by Joel Galenson! Differential Revision: https://reviews.llvm.org/D35641 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309457 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-23[PPC] Add generated tests for all atomic operationsTim Shen
Summary: Add tests for all atomic operations for powerpc64le, so that all changes can be easily examined. Reviewers: kbarton, hfinkel, echristo Subscribers: mehdi_amini, nemanjai, llvm-commits Differential Revision: https://reviews.llvm.org/D31285 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298614 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-17Add SystemZ to utils/update_llc_test_checks.py.Jonas Paulsson
Extend script for auto-generating CHECK lines so that it works for SystemZ. This is a pre-commit for the new tests resulting from https://reviews.llvm.org/D29489 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298048 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24[utils] allow auto-generation of checks for thumb triplesSanjay Patel
If there's some reason not to do this, feel free to revert and/or fix, but for the cases I'm looking at, the script appears to do fine for these targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296181 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24Add some testcases for bitfields with illegal widths.Eli Friedman
clang will generate IR like this for input using packed bitfields; very simple semantically, but it's a bit tricky to actually generate good code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296080 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14[utils] Improve extraction of check prefixes from RUN linesNikolai Bozhenov
Correct handling of the following FileCheck options is implemented in update_llc_test_checks.py and update_test_checks.py scripts: 1) -check-prefix (with a single dash) 2) -check-prefixes (with multiple prefixes) Differential Revision: https://reviews.llvm.org/D28572 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292008 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-29Fix indentation in r290716.Bryant Wong
Use two-space indentation like the rest of the file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290722 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-29Correctly handle multi-lined RUN lines.Bryant Wong
`utils/update_{llc_test,test}_checks` ought to be able to handle RUN commands that span multiple lines, as shown in the example at http://llvm.org/docs/CommandGuide/FileCheck.html#the-filecheck-check-prefix-option Differential Revision: https://reviews.llvm.org/D26523 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290716 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-22[PowerPC] Add ppc support to update_llc_test_checks.py, and ppc tests. NFC.Tim Shen
Reviewers: chandlerc, hfinkel, echristo, iteratee Subscribers: mehdi_amini, nemanjai, llvm-commits Differential Revision: https://reviews.llvm.org/D28036 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290370 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19Add ARM support to update_llc_test_checks.pyEli Friedman
Just the minimal support to get it working at the moment. Includes checks for test/CodeGen/ARM/vzip.ll as an example. Differential Revision: https://reviews.llvm.org/D27829 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290144 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07[X86] Fix test checks script to satisfy pyflakesZvi Rackover
- Remove unused imports. - Initialize the variable 'name' before its (static) uses, and rename it to a more descriptive name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286128 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07[X86] Fix test checks script to handle run lines with no pipe checksZvi Rackover
Fixes crashes in tests such as test/CodeGen/X86/masked_gather_scatter.ll which contains a RUN: with no pipe chain. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286125 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-03[X86][AVX512] Add support for masked shuffle commentsSimon Pilgrim
This patch adds support for including the avx512 mask register information in the mask/maskz versions of shuffle instruction comments. This initial version just adds support for MOVDDUP/MOVSHDUP/MOVSLDUP to reduce the mass of test regenerations, other shuffle instructions can be added in due course. Differential Revision: http://reviews.llvm.org/D21953 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274459 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-11[X86] Updated test checks script to generalise LCPI symbol refsSimon Pilgrim
The script now replace '.LCPI888_8' style asm symbols with the {{\.LCPI.*}} re pattern - this helps stop hardcoded symbols in 32-bit x86 tests changing with every edit of the file Refreshed some tests to demonstrate the new check git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272488 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24don't hardcode the name of the llc checks scriptSanjay Patel
We lose the 'utils' directory name in our advertising line with this change. We could retain that, but I don't see the point. This removes a dependency for making the script apply to more than 'llc'. Ie, we'll want to change the script name if it works with opt/clang too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264310 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24reorganize llc checks script to allow more flexibility, part 2; NFCISanjay Patel
The goal is to enhance this script to be used with opt and clang: Break 'main' into functions and change variable names to be more generic because we want to handle more than x86 asm output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264307 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23reorganize llc checks script to allow more flexibility; NFCISanjay Patel
The goal is to enhance this script to be used with opt and clang: Group all of the regexes together, so it's easier to see what's going on. This will make it easier to break main() up into pieces too. Also, note that some of the regexes are for x86-specific asm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264197 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27[utils] Add windows support to update_llc_test_checks.pySimon Pilgrim
Strip dos line endings from llc generated files to allow the regex patterns to match them. Ensure updated *.ll files are generated with unix style line endings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258987 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-23Make utils/update_llc_test_checks.py note that the assertions areJames Y Knight
autogenerated. Also update existing test cases which appear to be generated by it and weren't modified (other than addition of the header) by rerunning it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253917 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15[x86] Teach my test updating script about another quirk of the printedChandler Carruth
asm and port the mmx vector shuffle test to it. Not thrilled with how it handles the stack manipulation logic, but I'm much less bothered by that than I am by updating the test manually. =] If anyone wants to teach the test checks management script about stack adjustment patterns, that'd be cool too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229268 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04[x86] Teach the test update script to strip trailing whitespace.Chandler Carruth
This is done in a bit of a strange way to use a multiline RE instead of looping over the lines. Suggestions welcome here for a more pythonic way of doing this as long as its reasonably fast. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228131 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03[x86] Tweak my update script to use test case function names startingChandler Carruth
with 'stress' to indicate that the specific output isn't interesting and relax them to only check the last instruction (a ret). I've updated the one test case that really uses this to name the one 'stress_test' which was actually producing output we can directly check. With this, the script doesn't introduce noise when run over the v16 test file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228033 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-12Add a new utility script that helps update very simple regression tests.Chandler Carruth
This script is currently specific to x86 and limited to use with very small regression or feature tests using 'llc' and 'FileCheck' in a reasonably canonical way. It is in no way general purpose or robust at this point. However, it works quite well for simple examples. Here is the intended workflow: - Make a change that requires updating N test files and M functions' assertions within those files. - Stash the change. - Update those N test files' RUN-lines to look "canonical"[1]. - Refresh the FileCheck lines for either the entire file or select functions by running this script. - The script will parse the RUN lines and run the 'llc' binary you give it according to each line, collecting the asm. - It will then annotate each function with the appropriate FileCheck comments to check every instruction from the start of the first basic block to the last return. - There will be numerous cases where the script either fails to remove the old lines, or inserts checks which need to be manually editted, but the manual edits tend to be deletions or replacements of registers with FileCheck variables which are fast manual edits. - A common pattern is to have the script insert complete checking of every instruction, and then edit it down to only check the relevant ones. - Be careful to do all of these cleanups though! The script is designed to make transferring and formatting the asm output of llc into a test case fast, it is *not* designed to be authoratitive about what constitutes a good test! - Commit the nice fresh baseline of checks. - Unstash your change and rebuild llc. - Re-run script to regenerate the FileCheck annotations - Remember to re-cleanup these annotations!!! - Check the diff to make sure this is sane, checking the things you expected it to, and check that the newly updated tests actually pass. - Profit! Also, I'm *terrible* at writing Python, and frankly I didn't spend a lot of time making this script beautiful or well engineered. But it's useful to me and may be useful to others so I thought I'd send it out. http://reviews.llvm.org/D5546 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225618 91177308-0d34-0410-b5e6-96231b3b80d8