1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/Other
Michael Kruse f48207fec4 [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes.
When multiple loop transformation are defined in a loop's metadata, their order of execution is defined by the order of their respective passes in the pass pipeline. For instance, e.g.

    #pragma clang loop unroll_and_jam(enable)
    #pragma clang loop distribute(enable)

is the same as

    #pragma clang loop distribute(enable)
    #pragma clang loop unroll_and_jam(enable)

and will try to loop-distribute before Unroll-And-Jam because the LoopDistribute pass is scheduled after UnrollAndJam pass. UnrollAndJamPass only supports one inner loop, i.e. it will necessarily fail after loop distribution. It is not possible to specify another execution order. Also,t the order of passes in the pipeline is subject to change between versions of LLVM, optimization options and which pass manager is used.

This patch adds 'followup' attributes to various loop transformation passes. These attributes define which attributes the resulting loop of a transformation should have. For instance,

    !0 = !{!0, !1, !2}
    !1 = !{!"llvm.loop.unroll_and_jam.enable"}
    !2 = !{!"llvm.loop.unroll_and_jam.followup_inner", !3}
    !3 = !{!"llvm.loop.distribute.enable"}

defines a loop ID (!0) to be unrolled-and-jammed (!1) and then the attribute !3 to be added to the jammed inner loop, which contains the instruction to distribute the inner loop.

Currently, in both pass managers, pass execution is in a fixed order and UnrollAndJamPass will not execute again after LoopDistribute. We hope to fix this in the future by allowing pass managers to run passes until a fixpoint is reached, use Polly to perform these transformations, or add a loop transformation pass which takes the order issue into account.

For mandatory/forced transformations (e.g. by having been declared by #pragma omp simd), the user must be notified when a transformation could not be performed. It is not possible that the responsible pass emits such a warning because the transformation might be 'hidden' in a followup attribute when it is executed, or it is not present in the pipeline at all. For this reason, this patche introduces a WarnMissedTransformations pass, to warn about orphaned transformations.

Since this changes the user-visible diagnostic message when a transformation is applied, two test cases in the clang repository need to be updated.

To ensure that no other transformation is executed before the intended one, the attribute `llvm.loop.disable_nonforced` can be added which should disable transformation heuristics before the intended transformation is applied. E.g. it would be surprising if a loop is distributed before a #pragma unroll_and_jam is applied.

With more supported code transformations (loop fusion, interchange, stripmining, offloading, etc.), transformations can be used as building blocks for more complex transformations (e.g. stripmining+stripmining+interchange -> tiling).

Reviewed By: hfinkel, dmgreen

Differential Revision: https://reviews.llvm.org/D49281
Differential Revision: https://reviews.llvm.org/D55288

llvm-svn: 348944
2018-12-12 17:32:52 +00:00
..
Inputs
X86 [CodeGen] fix broken successor probability in MBB dump 2018-09-28 05:27:32 +00:00
2002-01-31-CallGraph.ll
2002-02-24-InlineBrokePHINodes.ll
2002-03-11-ConstPropCrash.ll
2003-02-19-LoopInfoNestingBug.ll
2004-08-16-PackedConstantInlineStore.ll
2004-08-16-PackedGlobalConstant.ll
2004-08-16-PackedSelect.ll
2004-08-16-PackedSimple.ll
2004-08-20-PackedControlFlow.ll
2006-02-05-PassManager.ll
2007-04-24-eliminate-mostly-empty-blocks.ll Fix inconsistency with/without debug information (-g) 2018-08-07 12:14:01 +00:00
2007-06-05-PassID.ll Revert "Extend CFGPrinter and CallPrinter with Heat Colors" 2018-06-29 17:48:58 +00:00
2007-06-28-PassManager.ll
2007-09-10-PassManager.ll
2008-02-14-PassManager.ll
2008-06-04-FieldSizeInPacked.ll
2008-10-06-RemoveDeadPass.ll
2008-10-15-MissingSpace.ll
2009-03-31-CallGraph.ll
2009-06-05-no-implicit-float.ll
2009-09-14-function-elements.ll
2010-05-06-Printer.ll Print newline after banner for ModulePass 2018-11-14 10:05:28 +00:00
attribute-comment.ll
bcanalyzer-block-info.txt
can-execute.txt test/Other/can-execute.txt: delete %t after the test 2018-09-14 20:41:42 +00:00
cfg-printer-branch-weights.ll [CFG Printer] Add support for writing the dot files with a custom 2018-10-09 04:30:23 +00:00
cgscc-devirt-iteration.ll
cgscc-disconnected-invalidation.ll
cgscc-iterate-function-mutation.ll
cgscc-libcall-update.ll
cgscc-observe-devirt.ll
cleanup-lcssa.ll
close-stderr.ll
codegenprepare-and-debug.ll Fix inconsistency with/without debug information (-g) 2018-08-07 12:14:01 +00:00
constant-fold-gep-address-spaces.ll
constant-fold-gep.ll
debugcounter-dce.ll [DCE] Add DebugCounter support 2018-09-13 20:29:50 +00:00
debugcounter-earlycse.ll
debugcounter-newgvn.ll
debugcounter-predicateinfo.ll [PredicateInfo] Use custom mangling to support ssa_copy with unnamed types. 2018-07-24 14:49:52 +00:00
extract-alias.ll
extract-linkonce.ll
extract-weak-odr.ll
extract.ll
FileCheck-space.txt
invalid-commandline-option.ll
invariant.group.ll Implement strip.invariant.group 2018-07-02 04:49:30 +00:00
lint.ll
lit-globbing.ll
lit-quoting.txt
lit-unicode.txt
llvm-nm-without-aliases.ll
loop-deletion-printer.ll [NewPM] fixing asserts on deleted loop in -print-after-all 2018-12-11 19:05:35 +00:00
loop-pass-ordering.ll
loop-pass-printer.ll [New PM][PassInstrumentation] IR printing support for New Pass Manager 2018-09-24 16:08:15 +00:00
loop-pm-invalidation.ll [New PM] Introducing PassInstrumentation framework 2018-09-20 17:08:45 +00:00
machine-size-remarks.ll Add REQUIRES line to machine-size-remarks 2018-09-10 23:53:08 +00:00
new-pass-manager.ll [New PM] Introducing PassInstrumentation framework 2018-09-20 17:08:45 +00:00
new-pm-defaults.ll [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes. 2018-12-12 17:32:52 +00:00
new-pm-lto-defaults.ll Recommit r346483: [CallSiteSplitting] Only record conditions up to the IDom(call site). 2018-11-14 10:04:30 +00:00
new-pm-pgo.ll
new-pm-thinlto-defaults.ll [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes. 2018-12-12 17:32:52 +00:00
opt-bisect-helper.py
opt-bisect-legacy-pass-manager.ll [lit, python] Always add quotes around the python path in lit 2018-08-06 22:37:44 +00:00
opt-hot-cold-split.ll [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes. 2018-12-12 17:32:52 +00:00
opt-O0-pipeline.ll
opt-O2-pipeline.ll [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes. 2018-12-12 17:32:52 +00:00
opt-O3-pipeline.ll [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes. 2018-12-12 17:32:52 +00:00
opt-Os-pipeline.ll [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes. 2018-12-12 17:32:52 +00:00
opt-override-mcpu-mattr.ll
opt-twice.ll
optimization-remarks-inline.ll
optimization-remarks-invalidation.ll
optimization-remarks-lazy-bfi.ll
optimize-inrange-gep.ll Prevent Constant Folding From Optimizing inrange GEP 2018-09-11 01:53:36 +00:00
optimize-options.ll
pass-pipeline-parsing.ll [NewPM] Fixing test failure on Windows - removed opt binary name from pattern 2018-10-17 11:01:15 +00:00
pass-pipelines.ll
pipefail.txt
pr32085.ll
print-debug-counter.ll Actually fix test from r345085 REQUIRE: asserts 2018-10-23 22:07:34 +00:00
print-module-scope.ll [New PM][PassInstrumentation] IR printing support for New Pass Manager 2018-09-24 16:08:15 +00:00
printer.ll [New PM][PassInstrumentation] IR printing support for New Pass Manager 2018-09-24 16:08:15 +00:00
ResponseFile.ll
scc-deleted-printer.ll [NewPM] fixing asserts on deleted loop in -print-after-all 2018-12-11 19:05:35 +00:00
scc-pass-printer.ll Fixing -print-module-scope for legacy SCC passes 2018-12-03 14:48:15 +00:00
size-remarks.ll Make YAML quote forward slashes. 2018-10-12 16:31:20 +00:00
spir_cc.ll
statistic.ll Reland: [Timers] Use the pass argument name for JSON keys in time-passes 2018-06-13 21:03:56 +00:00
time-passes.ll [New PM][PassTiming] implement -time-passes for the new pass manager 2018-10-05 22:32:01 +00:00
umask.ll [CMake] Use normalized Windows target triples 2018-08-09 02:16:18 +00:00
writing-to-stdout.ll