Add loop optimizations & instr_import_limit=100

This commit is contained in:
Alexander David Frick 2021-11-27 23:14:20 -06:00 committed by GitHub
parent cd26498cc6
commit 22092abbe1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1849,15 +1849,15 @@ if (is_win) {
"/Oy-", # Disable omitting frame pointers, must be after /O2.
"/Zc:inline", # Remove unreferenced COMDAT (faster links).
"-mllvm", "-extra-vectorizer-passes",
"-mllvm", "-enable-cond-stores-vec",
"-mllvm", "-slp-vectorize-hor-store",
"-mllvm", "-enable-loopinterchange",
"-mllvm", "-enable-loop-distribute",
"-mllvm", "-enable-unroll-and-jam",
"-mllvm", "-enable-loop-flatten",
"-mllvm", "-interleave-small-loop-scalar-reduction",
"-mllvm", "-unroll-runtime-multi-exit",
"-mllvm", "-aggressive-ext-opt",
"-mllvm", "-enable-cond-stores-vec",
"-mllvm", "-slp-vectorize-hor-store",
"-mllvm", "-enable-loopinterchange",
"-mllvm", "-enable-loop-distribute",
"-mllvm", "-enable-unroll-and-jam",
"-mllvm", "-enable-loop-flatten",
"-mllvm", "-interleave-small-loop-scalar-reduction",
"-mllvm", "-unroll-runtime-multi-exit",
"-mllvm", "-aggressive-ext-opt",
]
if (!is_asan) {
common_optimize_on_cflags += [
@ -1868,28 +1868,28 @@ if (is_win) {
# it is not compatible with the ASan ODR checker.
"/Gw",
"-mllvm", "-extra-vectorizer-passes",
"-mllvm", "-enable-cond-stores-vec",
"-mllvm", "-slp-vectorize-hor-store",
"-mllvm", "-enable-loopinterchange",
"-mllvm", "-enable-loop-distribute",
"-mllvm", "-enable-unroll-and-jam",
"-mllvm", "-enable-loop-flatten",
"-mllvm", "-interleave-small-loop-scalar-reduction",
"-mllvm", "-unroll-runtime-multi-exit",
"-mllvm", "-aggressive-ext-opt",
"-mllvm", "-enable-cond-stores-vec",
"-mllvm", "-slp-vectorize-hor-store",
"-mllvm", "-enable-loopinterchange",
"-mllvm", "-enable-loop-distribute",
"-mllvm", "-enable-unroll-and-jam",
"-mllvm", "-enable-loop-flatten",
"-mllvm", "-interleave-small-loop-scalar-reduction",
"-mllvm", "-unroll-runtime-multi-exit",
"-mllvm", "-aggressive-ext-opt",
]
}
common_optimize_on_ldflags = [
"-mllvm:-extra-vectorizer-passes",
"-mllvm:-enable-cond-stores-vec",
"-mllvm:-slp-vectorize-hor-store",
"-mllvm:-enable-loopinterchange",
"-mllvm:-enable-loop-distribute",
"-mllvm:-enable-unroll-and-jam",
"-mllvm:-enable-loop-flatten",
"-mllvm:-interleave-small-loop-scalar-reduction",
"-mllvm:-unroll-runtime-multi-exit",
"-mllvm:-aggressive-ext-opt", ]
"-mllvm:-extra-vectorizer-passes",
"-mllvm:-enable-cond-stores-vec",
"-mllvm:-slp-vectorize-hor-store",
"-mllvm:-enable-loopinterchange",
"-mllvm:-enable-loop-distribute",
"-mllvm:-enable-unroll-and-jam",
"-mllvm:-enable-loop-flatten",
"-mllvm:-interleave-small-loop-scalar-reduction",
"-mllvm:-unroll-runtime-multi-exit",
"-mllvm:-aggressive-ext-opt", ]
# /OPT:ICF is not desirable in Debug builds, since code-folding can result in
# misleading symbols in stack traces.
@ -1897,30 +1897,30 @@ if (is_win) {
common_optimize_on_ldflags += [
"/OPT:ICF",
"-mllvm:-extra-vectorizer-passes",
"-mllvm:-enable-cond-stores-vec",
"-mllvm:-slp-vectorize-hor-store",
"-mllvm:-enable-loopinterchange",
"-mllvm:-enable-loop-distribute",
"-mllvm:-enable-unroll-and-jam",
"-mllvm:-enable-loop-flatten",
"-mllvm:-interleave-small-loop-scalar-reduction",
"-mllvm:-unroll-runtime-multi-exit",
"-mllvm:-aggressive-ext-opt", ] # Redundant COMDAT folding.
"-mllvm:-enable-cond-stores-vec",
"-mllvm:-slp-vectorize-hor-store",
"-mllvm:-enable-loopinterchange",
"-mllvm:-enable-loop-distribute",
"-mllvm:-enable-unroll-and-jam",
"-mllvm:-enable-loop-flatten",
"-mllvm:-interleave-small-loop-scalar-reduction",
"-mllvm:-unroll-runtime-multi-exit",
"-mllvm:-aggressive-ext-opt", ] # Redundant COMDAT folding.
}
if (is_official_build) {
common_optimize_on_ldflags += [
"/OPT:REF",
"-mllvm:-extra-vectorizer-passes",
"-mllvm:-enable-cond-stores-vec",
"-mllvm:-slp-vectorize-hor-store",
"-mllvm:-enable-loopinterchange",
"-mllvm:-enable-loop-distribute",
"-mllvm:-enable-unroll-and-jam",
"-mllvm:-enable-loop-flatten",
"-mllvm:-interleave-small-loop-scalar-reduction",
"-mllvm:-unroll-runtime-multi-exit",
"-mllvm:-aggressive-ext-opt", ] # Remove unreferenced data.
"-mllvm:-enable-cond-stores-vec",
"-mllvm:-slp-vectorize-hor-store",
"-mllvm:-enable-loopinterchange",
"-mllvm:-enable-loop-distribute",
"-mllvm:-enable-unroll-and-jam",
"-mllvm:-enable-loop-flatten",
"-mllvm:-interleave-small-loop-scalar-reduction",
"-mllvm:-unroll-runtime-multi-exit",
"-mllvm:-aggressive-ext-opt", ] # Remove unreferenced data.
# TODO(thakis): Add LTO/PGO clang flags eventually, https://crbug.com/598772
}
} else {
@ -1954,16 +1954,16 @@ if (is_win) {
common_optimize_on_ldflags += [
# Warn in case of text relocations.
"-Wl,--warn-shared-textrel",
"-mllvm:-extra-vectorizer-passes",
"-mllvm:-enable-cond-stores-vec",
"-mllvm:-slp-vectorize-hor-store",
"-mllvm:-enable-loopinterchange",
"-mllvm:-enable-loop-distribute",
"-mllvm:-enable-unroll-and-jam",
"-mllvm:-enable-loop-flatten",
"-mllvm:-interleave-small-loop-scalar-reduction",
"-mllvm:-unroll-runtime-multi-exit",
"-mllvm:-aggressive-ext-opt",
"-mllvm:-extra-vectorizer-passes",
"-mllvm:-enable-cond-stores-vec",
"-mllvm:-slp-vectorize-hor-store",
"-mllvm:-enable-loopinterchange",
"-mllvm:-enable-loop-distribute",
"-mllvm:-enable-unroll-and-jam",
"-mllvm:-enable-loop-flatten",
"-mllvm:-interleave-small-loop-scalar-reduction",
"-mllvm:-unroll-runtime-multi-exit",
"-mllvm:-aggressive-ext-opt",
]
}
}
@ -1972,30 +1972,30 @@ if (is_win) {
common_optimize_on_ldflags += [
"-Wl,-dead_strip",
"-mllvm:-extra-vectorizer-passes",
"-mllvm:-enable-cond-stores-vec",
"-mllvm:-slp-vectorize-hor-store",
"-mllvm:-enable-loopinterchange",
"-mllvm:-enable-loop-distribute",
"-mllvm:-enable-unroll-and-jam",
"-mllvm:-enable-loop-flatten",
"-mllvm:-interleave-small-loop-scalar-reduction",
"-mllvm:-unroll-runtime-multi-exit",
"-mllvm:-aggressive-ext-opt", ]
"-mllvm:-enable-cond-stores-vec",
"-mllvm:-slp-vectorize-hor-store",
"-mllvm:-enable-loopinterchange",
"-mllvm:-enable-loop-distribute",
"-mllvm:-enable-unroll-and-jam",
"-mllvm:-enable-loop-flatten",
"-mllvm:-interleave-small-loop-scalar-reduction",
"-mllvm:-unroll-runtime-multi-exit",
"-mllvm:-aggressive-ext-opt", ]
if (is_official_build) {
common_optimize_on_ldflags += [
"-Wl,-no_data_in_code_info",
"-Wl,-no_function_starts",
"-mllvm:-extra-vectorizer-passes",
"-mllvm:-enable-cond-stores-vec",
"-mllvm:-slp-vectorize-hor-store",
"-mllvm:-enable-loopinterchange",
"-mllvm:-enable-loop-distribute",
"-mllvm:-enable-unroll-and-jam",
"-mllvm:-enable-loop-flatten",
"-mllvm:-interleave-small-loop-scalar-reduction",
"-mllvm:-unroll-runtime-multi-exit",
"-mllvm:-aggressive-ext-opt",
"-mllvm:-extra-vectorizer-passes",
"-mllvm:-enable-cond-stores-vec",
"-mllvm:-slp-vectorize-hor-store",
"-mllvm:-enable-loopinterchange",
"-mllvm:-enable-loop-distribute",
"-mllvm:-enable-unroll-and-jam",
"-mllvm:-enable-loop-flatten",
"-mllvm:-interleave-small-loop-scalar-reduction",
"-mllvm:-unroll-runtime-multi-exit",
"-mllvm:-aggressive-ext-opt",
]
}
} else if (current_os != "aix" && current_os != "zos") {
@ -2008,30 +2008,30 @@ if (is_win) {
"-fdata-sections",
"-ffunction-sections",
"-mllvm", "-extra-vectorizer-passes",
"-mllvm", "-enable-cond-stores-vec",
"-mllvm", "-slp-vectorize-hor-store",
"-mllvm", "-enable-loopinterchange",
"-mllvm", "-enable-loop-distribute",
"-mllvm", "-enable-unroll-and-jam",
"-mllvm", "-enable-loop-flatten",
"-mllvm", "-interleave-small-loop-scalar-reduction",
"-mllvm", "-unroll-runtime-multi-exit",
"-mllvm", "-aggressive-ext-opt",
"-mllvm", "-enable-cond-stores-vec",
"-mllvm", "-slp-vectorize-hor-store",
"-mllvm", "-enable-loopinterchange",
"-mllvm", "-enable-loop-distribute",
"-mllvm", "-enable-unroll-and-jam",
"-mllvm", "-enable-loop-flatten",
"-mllvm", "-interleave-small-loop-scalar-reduction",
"-mllvm", "-unroll-runtime-multi-exit",
"-mllvm", "-aggressive-ext-opt",
]
if (!is_nacl && is_clang) {
# We don't care about unique section names, this makes object files a bit
# smaller.
common_optimize_on_cflags += [ "-fno-unique-section-names",
"-mllvm", "-extra-vectorizer-passes",
"-mllvm", "-enable-cond-stores-vec",
"-mllvm", "-slp-vectorize-hor-store",
"-mllvm", "-enable-loopinterchange",
"-mllvm", "-enable-loop-distribute",
"-mllvm", "-enable-unroll-and-jam",
"-mllvm", "-enable-loop-flatten",
"-mllvm", "-interleave-small-loop-scalar-reduction",
"-mllvm", "-unroll-runtime-multi-exit",
"-mllvm", "-aggressive-ext-opt", ]
"-mllvm", "-enable-cond-stores-vec",
"-mllvm", "-slp-vectorize-hor-store",
"-mllvm", "-enable-loopinterchange",
"-mllvm", "-enable-loop-distribute",
"-mllvm", "-enable-unroll-and-jam",
"-mllvm", "-enable-loop-flatten",
"-mllvm", "-interleave-small-loop-scalar-reduction",
"-mllvm", "-unroll-runtime-multi-exit",
"-mllvm", "-aggressive-ext-opt", ]
}
common_optimize_on_ldflags += [
@ -2040,16 +2040,16 @@ if (is_win) {
# -O2 enables string tail merge optimization in gold and lld.
"-Wl,-O3",
"-Wl,--gc-sections",
"-mllvm:-extra-vectorizer-passes",
"-mllvm:-enable-cond-stores-vec",
"-mllvm:-slp-vectorize-hor-store",
"-mllvm:-enable-loopinterchange",
"-mllvm:-enable-loop-distribute",
"-mllvm:-enable-unroll-and-jam",
"-mllvm:-enable-loop-flatten",
"-mllvm:-interleave-small-loop-scalar-reduction",
"-mllvm:-unroll-runtime-multi-exit",
"-mllvm:-aggressive-ext-opt",
"-mllvm:-extra-vectorizer-passes",
"-mllvm:-enable-cond-stores-vec",
"-mllvm:-slp-vectorize-hor-store",
"-mllvm:-enable-loopinterchange",
"-mllvm:-enable-loop-distribute",
"-mllvm:-enable-unroll-and-jam",
"-mllvm:-enable-loop-flatten",
"-mllvm:-interleave-small-loop-scalar-reduction",
"-mllvm:-unroll-runtime-multi-exit",
"-mllvm:-aggressive-ext-opt",
]
}
}