annotate polly/docs/TipsAndTricks.rst @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents 1f2b6ac9f198
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ==================================================
anatofuz
parents:
diff changeset
2 Tips and Tricks on using and contributing to Polly
anatofuz
parents:
diff changeset
3 ==================================================
anatofuz
parents:
diff changeset
4
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
5 Committing to polly trunk
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
6 -------------------------
150
anatofuz
parents:
diff changeset
7 - `General reference to git-svn workflow <https://stackoverflow.com/questions/190431/is-git-svn-dcommit-after-merging-in-git-dangerous>`_
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 Using bugpoint to track down errors in large files
anatofuz
parents:
diff changeset
11 --------------------------------------------------
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 If you know the ``opt`` invocation and have a large ``.ll`` file that causes
anatofuz
parents:
diff changeset
14 an error, ``bugpoint`` allows one to reduce the size of test cases.
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 The general calling pattern is:
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 - ``$ bugpoint <file.ll> <pass that causes the crash> -opt-args <opt option flags>``
anatofuz
parents:
diff changeset
19
anatofuz
parents:
diff changeset
20 An example invocation is:
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 - ``$ bugpoint crash.ll -polly-codegen -opt-args -polly-canonicalize -polly-process-unprofitable``
anatofuz
parents:
diff changeset
23
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
24 For more documentation on bugpoint, `Visit the LLVM manual <https://llvm.org/docs/Bugpoint.html>`_
150
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 Understanding which pass makes a particular change
anatofuz
parents:
diff changeset
28 --------------------------------------------------
anatofuz
parents:
diff changeset
29
anatofuz
parents:
diff changeset
30 If you know that something like `opt -O3 -polly` makes a change, but you wish to
anatofuz
parents:
diff changeset
31 isolate which pass makes a change, the steps are as follows:
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 - ``$ bugpoint -O3 file.ll -opt-args -polly`` will allow bugpoint to track down the pass which causes the crash.
anatofuz
parents:
diff changeset
34
anatofuz
parents:
diff changeset
35 To do this manually:
anatofuz
parents:
diff changeset
36
anatofuz
parents:
diff changeset
37 - ``$ opt -O3 -polly -debug-pass=Arguments`` to get all passes that are run by default. ``-debug-pass=Arguments`` will list all passes that have run.
anatofuz
parents:
diff changeset
38 - Bisect down to the pass that changes it.
anatofuz
parents:
diff changeset
39
anatofuz
parents:
diff changeset
40
anatofuz
parents:
diff changeset
41 Debugging regressions introduced at some unknown earlier point
anatofuz
parents:
diff changeset
42 --------------------------------------------------------------
anatofuz
parents:
diff changeset
43
anatofuz
parents:
diff changeset
44 In case of a regression in performance or correctness (e.g., an earlier version
anatofuz
parents:
diff changeset
45 of Polly behaved as expected and a later version does not), bisecting over the
anatofuz
parents:
diff changeset
46 version history is the standard approach to identify the commit that introduced
anatofuz
parents:
diff changeset
47 the regression.
anatofuz
parents:
diff changeset
48
anatofuz
parents:
diff changeset
49 LLVM has a single repository that contains all projects. It can be cloned at:
anatofuz
parents:
diff changeset
50 `<https://github.com/llvm/llvm-project>`_. How to bisect on a
anatofuz
parents:
diff changeset
51 git repository is explained here
anatofuz
parents:
diff changeset
52 `<https://www.metaltoad.com/blog/beginners-guide-git-bisect-process-elimination>`_.
anatofuz
parents:
diff changeset
53 The bisect process can also be automated as explained here:
anatofuz
parents:
diff changeset
54 `<https://www.metaltoad.com/blog/mechanizing-git-bisect-bug-hunting-lazy>`_.
anatofuz
parents:
diff changeset
55 An LLVM specific run script is available here:
anatofuz
parents:
diff changeset
56 `<https://gist.github.com/dcci/891cd98d80b1b95352a407d80914f7cf>`_.