1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/tools
Teresa Johnson ca9019a39c Allow disabling of vectorization using internal options
Summary:
Currently, the internal options -vectorize-loops, -vectorize-slp, and
-interleave-loops do not have much practical effect. This is because
they are used to initialize the corresponding flags in the pass
managers, and those flags are then unconditionally overwritten when
compiling via clang or via LTO from the linkers. The only exception was
-vectorize-loops via opt because of some special hackery there.

While vectorization could still be disabled when compiling via clang,
using -fno-[slp-]vectorize, this meant that there was no way to disable
it when compiling in LTO mode via the linkers. This only affected
ThinLTO, since for regular LTO vectorization is done during the compile
step for scalability reasons. For ThinLTO it is invoked in the LTO
backends. See also the discussion on PR45434.

This patch makes it so the internal options can actually be used to
disable these optimizations. Ultimately, the best long term solution is
to mark the loops with metadata (similar to the approach used to fix
-fno-unroll-loops in D77058), but this enables a shorter term
workaround, and actually makes these internal options useful.

I constant propagated the initial values of these internal flags into
the pass manager flags (for some reasons vectorize-loops and
interleave-loops were initialized to true, while vectorize-slp was
initialized to false). As mentioned above, they are overwritten
unconditionally so this doesn't have any real impact, and these initial
values aren't particularly meaningful.

I then changed the passes to check the internl values and return without
performing the associated optimization when false (I changed the default
of -vectorize-slp to true so the options behave similarly). I was able
to remove the hackery in opt used to get -vectorize-loops=false to work,
as well as a special option there used to disable SLP vectorization.

Finally, I changed thinlto-slp-vectorize-pm.c to:
a) Only test SLP (moved the loop vectorization checking to a new test).
b) Use code that is slp vectorized when it is enabled, and check that
instead of whether the pass is enabled.
c) Test the new behavior of -vectorize-slp.
d) Test both pass managers.

The loop vectorization (and associated interleaving) testing I moved to
a new thinlto-loop-vectorize-pm.c test, with several changes:
a) Changed the flags on the interleaving testing so that it will
actually interleave, and check that.
b) Test the new behavior of -vectorize-loops and -interleave-loops.
c) Test both pass managers.

Reviewers: fhahn, wmi

Subscribers: hiraditya, steven_wu, dexonsmith, cfe-commits, davezarzycki, llvm-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D77989
2020-04-14 18:09:10 -07:00
..
bugpoint Don't export symbols from clang/opt/llc if plugins are disabled. 2020-03-23 12:17:09 -07:00
bugpoint-passes
dsymutil [DWARFLinker][dsymutil] followup for 88c2137b6d49f88186d0957a4e2d8030a3967334 2020-04-08 16:46:52 +03:00
gold Fix build after 09158252f777c2e2f06a86b154c44abcbcf9bb74 2020-03-27 11:23:11 -04:00
llc Make TargetPassConfig and llc add pre/post passes the same way. NFC 2020-04-10 13:46:53 -07:00
lli [ORC] Add MachO universal binary support to StaticLibraryDefinitionGenerator. 2020-04-05 20:21:05 -07:00
llvm-ar [llvm-ar] Use target triple to deduce archive kind for bitcode inputs 2020-03-20 13:19:44 -07:00
llvm-as [Assembler] Allow assembling empty index with non-zero flags 2020-02-26 16:34:11 +03:00
llvm-as-fuzzer
llvm-bcanalyzer
llvm-c-test Make IRBuilder automatically set alignment on load/store/alloca. 2020-04-13 13:43:14 -07:00
llvm-cat
llvm-cfi-verify
llvm-config
llvm-cov Simplify string joins. NFCI. 2020-04-11 17:20:11 +02:00
llvm-cvtres
llvm-cxxdump
llvm-cxxfilt
llvm-cxxmap
llvm-diff Avoid SmallString.h include in MD5.h, NFC 2020-02-26 09:10:24 -08:00
llvm-dis
llvm-dwarfdump Reapply "llvm-dwarfdump: Report errors when failing to parse loclist/debug_loc entries"" 2020-04-14 14:44:32 -07:00
llvm-dwp [llvm-dwp] Fix a possible out of bound access. 2020-04-06 14:31:00 +07:00
llvm-elfabi
llvm-exegesis [ADT/STLExtras.h] - Add llvm::is_sorted wrapper and update callers. 2020-04-14 14:11:02 +03:00
llvm-extract
llvm-go
llvm-gsymutil Fix GSYM tests to run the yaml files and fix test failures on some machines. 2020-03-04 19:14:08 -08:00
llvm-ifs [llvm][clang][IFS] Enhancing the llvm-ifs yaml format for symbol lists. 2020-04-01 10:49:06 -04:00
llvm-isel-fuzzer Replace MCTargetOptionsCommandFlags.inc and CommandFlags.inc by runtime registration 2020-03-17 14:01:30 +01:00
llvm-itanium-demangle-fuzzer
llvm-jitlink [llvm-jitlink] Add -show-init-es option to dump initial ExecutionSession state. 2020-03-14 16:07:46 -07:00
llvm-jitlistener
llvm-link [ThinLTO] Drop dso_local if a GlobalVariable satisfies isDeclarationForLinker() 2020-04-07 15:46:01 -07:00
llvm-lipo Suppress a few -Wunreachable-code warnings. 2020-03-25 13:55:42 -04:00
llvm-lto Replace MCTargetOptionsCommandFlags.inc and CommandFlags.inc by runtime registration 2020-03-17 14:01:30 +01:00
llvm-lto2 Enable new passmanager plugin support for LTO. 2020-04-14 15:07:07 -07:00
llvm-mc Replace MCTargetOptionsCommandFlags.inc and CommandFlags.inc by runtime registration 2020-03-17 14:01:30 +01:00
llvm-mc-assemble-fuzzer Replace MCTargetOptionsCommandFlags.inc and CommandFlags.inc by runtime registration 2020-03-17 14:01:30 +01:00
llvm-mc-disassemble-fuzzer
llvm-mca Replace MCTargetOptionsCommandFlags.inc and CommandFlags.inc by runtime registration 2020-03-17 14:01:30 +01:00
llvm-microsoft-demangle-fuzzer
llvm-ml Replace MCTargetOptionsCommandFlags.inc and CommandFlags.inc by runtime registration 2020-03-17 14:01:30 +01:00
llvm-modextract
llvm-mt
llvm-nm
llvm-objcopy [ADT/STLExtras.h] - Add llvm::is_sorted wrapper and update callers. 2020-04-14 14:11:02 +03:00
llvm-objdump [llvm-objdump][Wasm][NFC] Create WasmDump.h 2020-04-14 18:26:24 -04:00
llvm-opt-fuzzer Replace MCTargetOptionsCommandFlags.inc and CommandFlags.inc by runtime registration 2020-03-17 14:01:30 +01:00
llvm-opt-report
llvm-pdbutil
llvm-profdata Recommit [SampleFDO] Add flag for partial profile. 2020-04-07 14:28:25 -07:00
llvm-rc [llvm-rc] Allow -1 for menu item IDs 2020-03-28 14:32:08 +02:00
llvm-readobj [NFC][XCOFF] refactor readobj/XCOFFDumper.cpp 2020-04-07 11:33:31 -04:00
llvm-reduce
llvm-rtdyld
llvm-shlib Check LLVM_BUILD_LLVM_C_DYLIB before building the C DLL with MSVC. 2020-04-07 13:13:58 -04:00
llvm-size
llvm-special-case-list-fuzzer
llvm-split
llvm-stress [llvm-stress][opaque pointers] Remove use of deprecated constructor 2020-04-03 18:00:33 -07:00
llvm-strings
llvm-symbolizer Switch this function to the LLVM variable naming convention, to match the rest of the file. 2020-03-31 13:43:19 -07:00
llvm-undname
llvm-xray [XRay] Sanitize DOT labels in graph output 2020-03-09 12:05:57 +00:00
llvm-yaml-numeric-parser-fuzzer
lto Replace MCTargetOptionsCommandFlags.inc and CommandFlags.inc by runtime registration 2020-03-17 14:01:30 +01:00
msbuild
obj2yaml [obj2yaml] - Do not dump the segment's "Align" field when it is equal to 1. 2020-04-09 14:20:36 +03:00
opt Allow disabling of vectorization using internal options 2020-04-14 18:09:10 -07:00
opt-viewer Convert old python3 cgi method into the new html one 2020-03-25 22:38:55 +01:00
remarks-shlib
sancov
sanstats
verify-uselistorder
vfabi-demangle-fuzzer
xcode-toolchain
yaml2obj
CMakeLists.txt [Flang] add flang as a new subproject in cmake 2020-04-09 16:13:18 +01:00
LLVMBuild.txt