[polly] Introduce -polly-print-* passes to replace -analyze.The `opt -analyze` option only works with the legacy pass manager and might be removed in the future, as explained in llvm.org/PR53733. T
[polly] Introduce -polly-print-* passes to replace -analyze.The `opt -analyze` option only works with the legacy pass manager and might be removed in the future, as explained in llvm.org/PR53733. This patch introduced -polly-print-* passes that print what the pass would print with the `-analyze` option and replaces all uses of `-analyze` in the regression tests.There are two exceptions: `CodeGen\single_loop_param_less_equal.ll` and `CodeGen\loop_with_condition_nested.ll` use `-analyze on the `-loops` pass which is not part of Polly.Reviewed By: aeubanksDifferential Revision: https://reviews.llvm.org/D120782
show more ...
[polly] Remove trailing whitespace from tests. NFC.
[Polly] Fix wrong redirect in test case.
[Polly] Implement user-directed loop distribution/fission.This is a simple version without the possibility to define distributepoints or followup-transformations. However, it is the firsttransfor
[Polly] Implement user-directed loop distribution/fission.This is a simple version without the possibility to define distributepoints or followup-transformations. However, it is the firsttransformation that has to check whether the transformation is correct.It interprets the same metadata as the LoopDistribute pass.Re-apply after revert in c7bcd72a38bcf99e03e4651ed5204d1a1f2bf695 withfix: Take isBand out of #ifndef NDEBUG since it now is usedunconditionally.
Revert "[Polly] Implement user-directed loop distribution/fission."This reverts commit 52c30adc7dfe6334b71adf256d81f70e7b976143 whichbreaks the build when NDEBUG is defined.
[Polly] Implement user-directed loop distribution/fission.This is a simple version without the possibility to define distributepoints or followup-transformations. However, it is the firsttransformation that has to check whether the transformation is correct.It interprets the same metadata as the LoopDistribute pass.
[Polly][ManualOpt] Match interpretation of unroll metadata to LoopUnrolls's.We previously had a different interpretation of unroll transformationattributes than how LoopUnroll interpreted it. In p
[Polly][ManualOpt] Match interpretation of unroll metadata to LoopUnrolls's.We previously had a different interpretation of unroll transformationattributes than how LoopUnroll interpreted it. In particular,llvm.loop.unroll.enable was needed explicitly to enable it and disablingmetadata was ignored.Additionally, it required that either full unrolling or an unroll factorto be specified or fail otherwise. An unroll factor is still required,but the transformation is ignored with the hope that LoopUnroll is goingto apply the unrolling, since Polly currently does not implement anheuristic.Fixes llvm.org/PR50109
[Polly][Unroll] Fix unroll_double test.We enumerated the cross product Domain x Scatter, but sorted only be thescatter key. In case there are are multiple statement instances perscatter value, th
[Polly][Unroll] Fix unroll_double test.We enumerated the cross product Domain x Scatter, but sorted only be thescatter key. In case there are are multiple statement instances perscatter value, the order between statement instances of the same loopiteration was undefined.Propertly enumerate and sort only by the scatter value, and group thedomains using the scatter dimension again.Thanks to Leonard Chan for the report.
[Polly][Optimizer] Apply user-directed unrolling.Make Polly look for unrolling metadata (https://llvm.org/docs/TransformMetadata.html#loop-unrolling) that is usually only interpreted by the LoopUnr
[Polly][Optimizer] Apply user-directed unrolling.Make Polly look for unrolling metadata (https://llvm.org/docs/TransformMetadata.html#loop-unrolling) that is usually only interpreted by the LoopUnroll pass and apply it to the SCoP's schedule.While not that useful by itself (there already is an unroll pass), it introduces mechanism to apply arbitrary loop transformation directives in arbitrary order to the schedule. Transformations are applied until no more directives are found. Since ISL's rescheduling would discard the manual transformations and it is assumed that when the user specifies the sequence of transformations, they do not want any other transformations to apply. Applying user-directed transformations can be controlled using the `-polly-pragma-based-opts` switch and is enabled by default.This does not influence the SCoP detection heuristic. As a consequence, loop that do not fulfill SCoP requirements or the initial profitability heuristic will be ignored. `-polly-process-unprofitable` can be used to disable the latter.Other than manually editing the IR, there is currently no way for the user to add loop transformations in an order other than the order in the default pipeline, or transformations other than the one supported by clang's LoopHint. See the `unroll_double.ll` test as example that clang currently is unable to emit. My own extension of `#pragma clang loop` allowing an arbitrary order and additional transformations is available here: https://github.com/meinersbur/llvm-project/tree/pragma-clang-loop. An effort to upstream this functionality as `#pragma clang transform` (because `#pragma clang loop` has an implicit transformation order defined by the loop pipeline) is D69088.Additional transformations from my downstream pragma-clang-loop branch are tiling, interchange, reversal, unroll-and-jam, thread-parallelization and array packing. Unroll was chosen because it uses already-defined metadata and does not require correctness checks.Reviewed By: sebastiankreutzerDifferential Revision: https://reviews.llvm.org/D97977