diff options
author | Tim Renouf <tpr.llvm@botech.co.uk> | 2018-05-25 07:55:04 +0000 |
---|---|---|
committer | Tim Renouf <tpr.llvm@botech.co.uk> | 2018-05-25 07:55:04 +0000 |
commit | ad8b7c1190b963e9df1757fbb28f14f2f34ec9a2 (patch) | |
tree | a89b97b0a729b8a699e572dbd66048afd72a5513 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | b161db099db7d611c14f64d36a57767f62d0a430 (diff) | |
download | llvm-ad8b7c1190b963e9df1757fbb28f14f2f34ec9a2.zip llvm-ad8b7c1190b963e9df1757fbb28f14f2f34ec9a2.tar.gz llvm-ad8b7c1190b963e9df1757fbb28f14f2f34ec9a2.tar.bz2 |
[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
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions