Index: TipsAndTricks.rst =================================================================== --- TipsAndTricks.rst +++ TipsAndTricks.rst @@ -13,15 +13,35 @@ If you know the ``opt`` invocation and have a large ``.ll`` file that causes an error, ``bugpoint`` allows one to reduce the size of test cases. - The general calling pattern is: + The general calling pattern of ``bugpoint`` to reduce a .ll file on which Polly crashes is: - - ``$ bugpoint -opt-args `` + - ``$ bugpoint -safe-auto -compile-custom -compile-command=`` + + ``-opt-command= -opt-args=`` + + + By doing so we avoid testing ``llc``, which is another component ``bugpoint`` can test, since it can give errors like: <> . + + We advise the user to give all these arguments: compile-command, opt-command, although they repeat the information. An example invocation is: - - ``$ bugpoint crash.ll -polly-codegen -opt-args -polly-canonicalize -polly-process-unprofitable`` + - ``$ clang -O3 -mllvm -disable-llvm-optzns -emit-llvm -S -o file_noopt.ll -g file.c`` + - ``$ bugpoint file_noopt.ll -safe-auto -compile-custom`` + + ``-compile-command="/llvm/bin/opt -O3 -polly -S"`` + + ``-opt-command=/llvm/bin/opt -opt-args="-polly -S"`` + + + For more documentation on bugpoint, `Visit the LLVM manual `_, the `Command Guide `_ and also the `LLVM blog `_ . + + It is worth mentioning that bugpoint can take a long time to finish, for example 39 hours running on 1 core of a workstation. + Note that running a release build of LLVM reduces the total runtime to 5.22 hours. + + Note that since the ``bugpoint`` tool can be a bit tricky to use with Polly, if you have problems you can best check the source code of the bugpoint tool. + For example, to avoid the error "Sorry, I can't automatically select a safe interpreter!" we had to get inspired directly from the source code file: https://github.com/llvm-mirror/llvm/blob/master/tools/bugpoint/ExecutionDriver.cpp in order to use a command line as indicated above, with arguments compile-command, opt-command, opt-args. - For more documentation on bugpoint, `Visit the LLVM manual `_ Understanding which pass makes a particular change