llvm-project/llvm
Tim Renouf ad8b7c1190 [AMDGPU] Fixed incorrect break from loop
Summary:
Lower control flow did not correctly handle the case that a loop break
in if/else was on a condition that was not guaranteed to be masked by
exec. The first test kernel shows an example of this going wrong; after
exiting the loop, exec is all ones, even if it was not before the loop.

The fix is for lowering of if-break and else-break to insert an
S_AND_B64 to mask the break condition with exec. This commit also
includes the optimization of not inserting that S_AND_B64 if it is
obviously not needed because the break condition is the result of a
V_CMP in the same basic block.

V2: Addressed some review comments.
V3: Test fixes.

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, t-tye, llvm-commits

Differential Revision: https://reviews.llvm.org/D44046

Change-Id: I0fc56a01209a9e99d1d5c9b0ffd16f111caf200c
llvm-svn: 333258
2018-05-25 07:55:04 +00:00
..
bindings [LLVM-C] Consolidate llgo's DIBuilder Bindings 2018-05-10 21:10:06 +00:00
cmake Remove CMake workaround for LLD PR24476 which is no longer needed 2018-05-21 20:14:46 +00:00
docs [llvm-exegesis] Show sched class details in analysis. 2018-05-24 10:47:05 +00:00
examples Unbreak kaleidoscope example. 2018-05-21 22:09:45 +00:00
include [x86] invpcid LLVM intrinsic 2018-05-25 06:32:05 +00:00
lib [AMDGPU] Fixed incorrect break from loop 2018-05-25 07:55:04 +00:00
projects
resources
runtimes [CMake] Pass Clang defaults to runtimes builds 2018-05-22 00:43:04 +00:00
test [AMDGPU] Fixed incorrect break from loop 2018-05-25 07:55:04 +00:00
tools [llvm-symbolizer] Simplify. NFC 2018-05-25 00:11:15 +00:00
unittests [ORC] Add findSymbolIn() wrapper to C bindings, take #2. 2018-05-24 18:44:34 +00:00
utils Use quoteattr to ensure we make well formed attributes 2018-05-25 00:31:36 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
.gitignore
CMakeLists.txt [cmake] Add a switch to enable/disable bindings. 2018-05-20 08:37:54 +00:00
CODE_OWNERS.TXT [CODE_OWNERS] Update my email address. 2018-04-23 19:09:49 +00:00
CREDITS.TXT Update my information in the CREDITS file. 2018-05-23 14:44:42 +00:00
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

Low Level Virtual Machine (LLVM)
================================

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.