1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
Go to file
Cullen Rhodes c640adbe73 [LV] Clamp VF hint when unsafe
In the following loop the dependence distance is 2 and can only be
vectorized if the vector length is no larger than this.

  void foo(int *a, int *b, int N) {
    #pragma clang loop vectorize(enable) vectorize_width(4)
    for (int i=0; i<N; ++i) {
      a[i + 2] = a[i] + b[i];
    }
  }

However, when specifying a VF of 4 via a loop hint this loop is
vectorized. According to [1][2], loop hints are ignored if the
optimization is not safe to apply.

This patch introduces a check to bail of vectorization if the user
specified VF is greater than the maximum feasible VF, unless explicitly
forced with '-force-vector-width=X'.

[1] https://llvm.org/docs/LangRef.html#llvm-loop-vectorize-and-llvm-loop-interleave
[2] https://clang.llvm.org/docs/LanguageExtensions.html#extensions-for-loop-hint-optimizations

Reviewed By: sdesmalen, fhahn, Meinersbur

Differential Revision: https://reviews.llvm.org/D90687
2020-12-01 11:30:34 +00:00
benchmarks
bindings Adding PoisonValue for representing poison value explicitly in IR 2020-11-25 17:33:51 -07:00
cmake [clangd] Fix use of system-installed GRPC after f726101b6240a6740b3c0926af759da5e7336f8a 2020-11-26 23:08:27 +01:00
docs Recommit "[llvm-symbolizer] Switch to using native symbolizer by default on Windows" 2020-11-30 17:36:12 -08:00
examples llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
include [NFC][CostModel]Extend class IntrinsicCostAttributes to use ElementCount Type 2020-12-01 11:12:51 +00:00
lib [LV] Clamp VF hint when unsafe 2020-12-01 11:30:34 +00:00
projects llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
resources
runtimes [runtimes] Revert the libc++ __config_site change 2020-10-23 09:41:48 -04:00
test [LV] Clamp VF hint when unsafe 2020-12-01 11:30:34 +00:00
tools [obj2yaml] - Teach tool to emit the "SectionHeaderTable" key and sort sections by file offset. 2020-12-01 12:59:15 +03:00
unittests [clang][cli] Split DefaultAnyOf into a default value and ImpliedByAnyOf 2020-12-01 09:50:11 +01:00
utils [gn build] Manually merge 40659cd 2020-12-01 11:15:05 +01:00
.clang-format
.clang-tidy - Update .clang-tidy to ignore parameters of main like functions for naming violations in clang and llvm directory 2020-01-31 16:49:45 +00:00
.gitattributes Fix the "git modified" issue on the preserve-comments-crlf.s. 2019-09-10 12:17:49 +00:00
.gitignore [clangd] Store index in '.cache/clangd/index' instead of '.clangd/index' 2020-07-07 14:53:45 +02:00
CMakeLists.txt llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
CODE_OWNERS.TXT [CODE_OWNERS.TXT] Update to include yours truly as the TableGen owner 2020-11-12 09:49:00 -05:00
configure
CREDITS.TXT [NFC] Add contributors names to CREDITS.TXT 2020-10-07 13:22:55 -04:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
llvm.spec.in Update structured references to the license to the new license. 2019-01-19 11:30:51 +00:00
README.txt Test commit. 2020-03-14 18:08:26 -07:00
RELEASE_TESTERS.TXT Update the list of platforms & archs 2018-12-16 14:47:16 +00:00

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.