Lines Matching full:polly
2 Using Polly with Clang
5 This documentation discusses how Polly can be used in Clang to automatically
11 Warning: clang/LLVM/Polly need to be in sync (compiled from the same
14 Make Polly available from Clang
17 Polly is available through clang, opt, and bugpoint, if Polly was checked out
18 into tools/polly before compilation. No further configuration is needed.
20 Optimizing with Polly
23 Optimizing with Polly is as easy as adding -O3 -mllvm -polly to your compiler
24 flags (Polly is not available unless optimizations are enabled, such as
29 clang -O3 -mllvm -polly file.c
35 also need to add -mllvm -polly-parallel -lgomp to your CFLAGS.
39 clang -O3 -mllvm -polly -mllvm -polly-parallel -lgomp file.c
44 The following CL switch allows to choose Polly's OpenMP-backend:
46 -polly-omp-backend[=BACKEND]
52 -polly-num-threads[=NUM]
55 -polly-scheduling[=SCHED]
58 -polly-scheduling-chunksize[=CHUNK]
62 `polly-num-threads` and `polly-scheduling` switches, where the latter also has
70 -mllvm -polly-omp-backend=LLVM -mllvm -polly-num-threads=4
71 -mllvm -polly-scheduling=dynamic -mllvm -polly-scheduling-chunksize=1
77 -polly-vectorizer=stripmine to your CFLAGS.
81 clang -O3 -mllvm -polly -mllvm -polly-vectorizer=stripmine file.c
83 Isolate the Polly passes
86 Polly's analysis and transformation passes are run with many other
88 Polly are essential for its working, for instance the canonicalization
89 of loop. Therefore Polly is unable to optimize code straight out of
92 To get the LLVM-IR that Polly sees in the optimization pipeline, use the
97 clang file.c -c -O3 -mllvm -polly -mllvm -polly-dump-before-file=before-polly.ll
99 This writes a file 'before-polly.ll' containing the LLVM-IR as passed to
100 polly, after SSA transformation, loop canonicalization, inlining and
103 Thereafter, any Polly pass can be run over 'before-polly.ll' using the
104 'opt' tool. To find out which Polly passes are active in the standard
109 clang file.c -c -O3 -mllvm -polly -mllvm -debug-pass=Arguments
111 The Polly's passes are those between '-polly-detect' and
112 '-polly-codegen'. Analysis passes can be omitted. At the time of this
113 writing, the default Polly pass pipeline is:
117 opt before-polly.ll -polly-simplify -polly-optree -polly-delicm -polly-simplify -polly-prune-unprofitable -polly-opt-isl -polly-codegen
122 suitable for processing with Polly from C/C++/Objective C source code.
127 ('-polly-canonicalize'). This does /not/ include all the passes that run
128 before Polly in the default pass pipeline. The '-disable-O0-optnone'
136 clang file.c -c -O0 -Xclang -disable-O0-optnone -emit-llvm -S -o - | opt -polly-canonicalize -S
144 clang file.c -c -O1 -Xclang -disable-llvm-passes -emit-llvm -S -o - | opt -polly-canonicalize -S
146 As another alternative, Polly can be pushed in front of the pass
148 '-polly-canonicalize' passes.
152 clang file.c -c -O3 -mllvm -polly -mllvm -polly-position=early -mllvm -polly-dump-before-file=before-polly.ll
156 Polly supports further options that are mainly useful for the development or the
157 analysis of Polly. The relevant options can be added to clang by appending
160 Limit Polly to a single function
163 To limit the execution of Polly to a single function, use the option
164 -polly-only-func=functionname.
169 Polly normally regenerates LLVM-IR from the Polyhedral representation. To only
170 see the effects of the preparing transformation, but to disable Polly code
171 generation add the option polly-no-codegen.
175 Polly can use graphviz to show the SCoPs it detects in a program. The relevant
176 options are -polly-show, -polly-show-only, -polly-dot and -polly-dot-only. The
185 Polly uses by default the isl scheduling optimizer. The isl optimizer optimizes
187 To disable the optimizer entirely use the option -polly-optimizer=none.
193 wanted the option -polly-tiling=false can be used to disable it. (This option
199 The flags -polly-import and -polly-export allow the export and reimport of the
205 Viewing Polly Diagnostics with opt-viewer