Commit Graph

29 Commits

Author SHA1 Message Date
David Zarzycki 251014ce79 [Testing] Python 3 requires print to use parens
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372392 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-20 13:52:47 +00:00
David Blaikie bfb62257f8 llvm-reduce: Add pass to reduce instructions
Patch by Diego Treviño!

Differential Revision: https://reviews.llvm.org/D66263

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372282 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-19 00:59:27 +00:00
David Blaikie 99b6a1f72d llvm-reduce: Add pass to reduce basic blocks
Patch by Diego Treviño!

Differential Revision: https://reviews.llvm.org/D66320

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372264 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-18 21:45:05 +00:00
David Blaikie 596e6cecd1 llvm-reduce: Clean out previous test temp/output dir, since it was a dir and now it's used as just a single file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372054 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-16 23:56:26 +00:00
David Blaikie d632f745ef llvm-reduce: Make tests shell-independent by passing the interpreter on the command line rather than using #! in the test file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372049 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-16 23:41:19 +00:00
Tim Shen c77b243d05 Fix llvm-reduce tests so that they don't assume the source code is
writable.

Instead of copying over the original file permissions, just create
a new file and add the executable bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371772 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 21:03:49 +00:00
David Blaikie eed589befe llvm-reduce: For now, mark these tests as requiring a shell
(since they execute shell scripts/that's the only entry point at the
moment)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371764 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 19:50:54 +00:00
David Blaikie c8a342337b llvm-reduce: Remove unused plugin support/requirements
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371755 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 18:52:31 +00:00
David Blaikie ccef81bf70 Reapply llvm-reduce: Add pass to reduce parameters""
Fixing a couple of asan-identified bugs
* use of an invalid "Use" iterator after the element was removed
* use of StringRef to Function name after the Function was erased

This reapplies r371567, which was reverted in r371580.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371700 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 01:20:48 +00:00
David Blaikie bce2802386 PR43278: llvm-reduce: Use temporary file names (and ToolOutputFile) rather than unique ones - to ensure they're cleaned up
This modifies the tool somewhat to only create files when about to run
the "interestingness" test, and delete them immediately after - this
means some more files will be created sometimes (when "double checking"
work - which should probably be fixed/avoided anyway).

This now creates temporary files, rather than only unique ones, and also
uses ToolOutputFile (without ever calling "keep") to ensure the files
are deleted as soon as the interestingness test is run.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371696 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 00:31:57 +00:00
David Blaikie 06de30684d PR43278: Temporarily disable llvm-reduce tests due to exhausting temp files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371679 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-11 22:15:16 +00:00
David Blaikie efbc850369 Revert "llvm-reduce: Add pass to reduce parameters"
Looks to be failing on asan buildbots

This reverts commit r371567.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371580 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-11 00:44:17 +00:00
David Blaikie c74403f9b4 llvm-reduce: Add pass to reduce parameters
Patch by Diego Treviño!

Differential Revision: https://reviews.llvm.org/D65479

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371567 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-10 23:10:10 +00:00
David Blaikie 5fbb26ea5f llvm-reduce: Add pass to reduce Metadata
Patch by Diego Treviño!

Differential Revision: https://reviews.llvm.org/D65026

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371562 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-10 22:09:58 +00:00
David Blaikie 63f3f17e15 llvm-reduce: Simplify testing using -implicit-check-not
Also fix llvm-reduce to use the specified output file name directly,
without appending '.ll' to the name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371555 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-10 20:52:14 +00:00
David Blaikie c980605691 llvm-reduce: Use %python from lit to get the correct/valid python binary for the reduction script
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371143 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-05 23:33:44 +00:00
Diego Trevino Ferrer d2ce08c7fe [Bugpoint redesign] Added Pass to Remove Global Variables
Summary:
This pass tries to remove Global Variables, as well as their derived uses. For example if a variable `@x` is used by `%call1` and `%call2`, both these uses and the definition of `@x` are deleted. Moreover if `%call1` or `%call2` are used elsewhere those uses are also deleted, and so on recursively.

I'm still uncertain if this pass should remove derived uses, I'm open to suggestions.

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D64176

llvm-svn: 368918

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369061 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-15 22:54:09 +00:00
Diego Trevino Ferrer 218112228c [Bugpoint redesign] Output option can now print to STDOUT
Summary:
This also changes all the outs() statements to errs() so the output and
progress streams don't get mixed.

This has been added because D64176 had flaky tests, which I believe were because the reduced file was being catted into `FileCheck`, instead of being pass from STDOUT directly.

Reviewers: chandlerc, dblaikie, xbolva00

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66314

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369060 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-15 22:39:43 +00:00
Diego Trevino Ferrer db79238355 Revert [Bugpoint redesign] Added Pass to Remove Global Variables
This reverts r368918 because it was unstable!

It broke these builds:
 * http://lab.llvm.org:8011/builders/lld-x86_64-ubuntu-fast/builds/4649
 * http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/29966
 * http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/29964

But surprisingly this passed:
 * http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/29965

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369039 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-15 19:08:15 +00:00
Diego Trevino Ferrer 1956c0ef9b [Bugpoint redesign] Modified Functions pass to consider declarations
Summary: This modification was put in place so the `ReduceMetadata` pass doesn't have to consider debug functions

Reviewers: dblaikie

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66257

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368934 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 22:22:37 +00:00
Diego Trevino Ferrer dbc62cefba [Bugpoint redesign] Added Pass to Remove Global Variables
Summary:
This pass tries to remove Global Variables, as well as their derived uses. For example if a variable `@x` is used by `%call1` and `%call2`, both these uses and the definition of `@x` are deleted. Moreover if `%call1` or `%call2` are used elsewhere those uses are also deleted, and so on recursively.

I'm still uncertain if this pass should remove derived uses, I'm open to suggestions.

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D64176

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368918 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 21:01:19 +00:00
Diego Trevino Ferrer 8afd81dda1 Added Delta IR Reduction Tool
Summary: Tool parses input IR file, and runs the delta debugging algorithm to reduce the functions inside the input file.

Reviewers: alexshap, chandlerc

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D63672

llvm-svn: 368071

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368358 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-08 22:16:33 +00:00
Diego Trevino Ferrer 4575679a86 Revert Added Delta IR Reduction Tool
This reverts r368071 (git commit a2584978f5bb41973d65a145b0d9459b81e3ac6d)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368217 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-07 21:51:54 +00:00
Diego Trevino Ferrer c2ab705011 Added Delta IR Reduction Tool
Summary: Tool parses input IR file, and runs the delta debugging algorithm to reduce the functions inside the input file.

Reviewers: alexshap, chandlerc

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D63672

llvm-svn: 368071

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368214 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-07 21:37:11 +00:00
Petr Hosek ccab606286 Reverts commit r368117, r368115 and r368112
This reverts commits:

  "Added Delta IR Reduction Tool"
  "[Bugpoint redesign] Added Pass to Remove Global Variables"
  "Added Tool as Dependency to tests & fixed warnings"

Reduce/remove-funcs.ll is failing on bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368122 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-07 05:15:34 +00:00
Diego Trevino Ferrer 2e1b796e06 [Bugpoint redesign] Added Pass to Remove Global Variables
Summary:
This pass tries to remove Global Variables, as well as their derived uses. For example if a variable `@x` is used by `%call1` and `%call2`, both these uses and the definition of `@x` are deleted. Moreover if `%call1` or `%call2` are used elsewhere those uses are also deleted, and so on recursively.

I'm still uncertain if this pass should remove derived uses, I'm open to suggestions.

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D64176

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368115 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-07 00:42:50 +00:00
Diego Trevino Ferrer a78c448d93 Added Delta IR Reduction Tool
Summary: Tool parses input IR file, and runs the delta debugging algorithm to reduce the functions inside the input file.

Reviewers: alexshap, chandlerc

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D63672

llvm-svn: 368071

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368112 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-07 00:00:52 +00:00
Dmitri Gribenko c822cfb9f8 Revert "Added Delta IR Reduction Tool"
This reverts commit r368071, it broke buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368073 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-06 19:40:37 +00:00
Diego Trevino Ferrer dab6850b77 Added Delta IR Reduction Tool
Summary: Tool parses input IR file, and runs the delta debugging algorithm to reduce the functions inside the input file.

Reviewers: alexshap, chandlerc

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D63672

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368071 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-06 18:59:11 +00:00