diff options
author | David Blaikie <dblaikie@gmail.com> | 2019-09-19 00:59:27 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2019-09-19 00:59:27 +0000 |
commit | 798fe477e39db137ec0f76c94cbee17761bdef0a (patch) | |
tree | b8a115bbed0e3ea9a8d884ae70362755ee1ab819 /llvm/test/Reduce/Inputs | |
parent | e93aded7f02d661234ad81aac0785ccdef6a79dd (diff) | |
download | bcm5719-llvm-798fe477e39db137ec0f76c94cbee17761bdef0a.tar.gz bcm5719-llvm-798fe477e39db137ec0f76c94cbee17761bdef0a.zip |
llvm-reduce: Add pass to reduce instructions
Patch by Diego TreviƱo!
Differential Revision: https://reviews.llvm.org/D66263
llvm-svn: 372282
Diffstat (limited to 'llvm/test/Reduce/Inputs')
-rwxr-xr-x | llvm/test/Reduce/Inputs/remove-bbs.py | 1 | ||||
-rwxr-xr-x | llvm/test/Reduce/Inputs/remove-global-vars.py | 14 | ||||
-rwxr-xr-x | llvm/test/Reduce/Inputs/remove-instructions.py | 17 |
3 files changed, 28 insertions, 4 deletions
diff --git a/llvm/test/Reduce/Inputs/remove-bbs.py b/llvm/test/Reduce/Inputs/remove-bbs.py index 099e8781396..71f099daaba 100755 --- a/llvm/test/Reduce/Inputs/remove-bbs.py +++ b/llvm/test/Reduce/Inputs/remove-bbs.py @@ -1,5 +1,4 @@ import sys -import re InterestingBBs = 0 input = open(sys.argv[1], "r") diff --git a/llvm/test/Reduce/Inputs/remove-global-vars.py b/llvm/test/Reduce/Inputs/remove-global-vars.py index 81fbea937dd..1ae8b0e6e76 100755 --- a/llvm/test/Reduce/Inputs/remove-global-vars.py +++ b/llvm/test/Reduce/Inputs/remove-global-vars.py @@ -2,9 +2,17 @@ import sys +InterestingVar = 0 + input = open(sys.argv[1], "r") for line in input: - if "@interesting = global" in line: - sys.exit(0) + i = line.find(';') + if i >= 0: + line = line[:i] + if line.startswith("@interesting = global") or "@interesting" in line: + InterestingVar += 1 + +if InterestingVar == 4: + sys.exit(0) # interesting! -sys.exit(1) # IR isn't interesting +sys.exit(1) diff --git a/llvm/test/Reduce/Inputs/remove-instructions.py b/llvm/test/Reduce/Inputs/remove-instructions.py new file mode 100755 index 00000000000..df4d85dd4f4 --- /dev/null +++ b/llvm/test/Reduce/Inputs/remove-instructions.py @@ -0,0 +1,17 @@ +import sys + +InterestingInstructions = 0 + +input = open(sys.argv[1], "r") +for line in input: + i = line.find(';') + if i >= 0: + line = line[:i] + if "%interesting" in line: + InterestingInstructions += 1 + print InterestingInstructions + +if InterestingInstructions == 5: + sys.exit(0) # interesting! + +sys.exit(1) |