llvm-project/llvm
alex-t 1a33294652 [AMDGPU] Filtering out the inactive lanes bits when lowering copy to SCC
Normally, given that the DA results are kept consistent over the selection DAG, uniform comparisons get selected to S_CMP_* but divergent to V_CMP_*.  Sometimes, for the sake of efficiency,  SSA subgraphs may be converted to VALU to avoid repeatedly copying data back and forth. Hence we have to be able to sustain the correctness passing the i1 from VALU to SALU context and vice versa.

VALU operations only process the active lanes of the VGPR and ignore inactive ones.
Active lanes correspond to 1 bit in the EXEC mask register.
SALU represents i1 as just one bit but VALU as 64bits: 0/1 and 0/(0xffffffffffffffff & EXEC) respectively.
SALU uses one-bit conditional flag SCC but VALU - VCC that is a pair of 32-bit SGPRs

To expose SCC to the VALU context we need to convert the one-bit boolean value to the appropriate 64bit.
To return back to the SALU context we need to do the opposite.

To correctly convert 64bit VALU boolean to either 0 or 1 we need to filter out the bits corresponding to the inactive lanes.

Reviewed By: piotr

Differential Revision: https://reviews.llvm.org/D109900
2021-09-21 21:19:31 +03:00
..
benchmarks
bindings [NFC][C API] Make LLVMSetInstrParamAlignment's index param type LLVMAttributeIndex 2021-09-07 15:13:45 -07:00
cmake [llvm] Pass LLVM_CHECK_ENABLED_PROJECTS through in cross builds 2021-09-21 09:01:37 -04:00
docs [NFC] Update the list of subprojects in docs. 2021-09-21 17:27:13 +02:00
examples
include [CodeGen] Remove redundant declaration getFileType (NFC) 2021-09-21 09:12:30 -07:00
lib [AMDGPU] Filtering out the inactive lanes bits when lowering copy to SCC 2021-09-21 21:19:31 +03:00
projects
resources
runtimes [libomptarget][amdcgn] Only add opt/llvm-link dependency if TARGET is available 2021-08-30 17:32:11 +02:00
test [AMDGPU] Filtering out the inactive lanes bits when lowering copy to SCC 2021-09-21 21:19:31 +03:00
tools [RISCV] Add a pass to recognize VLS strided loads/store from gather/scatter. 2021-09-20 09:39:44 -07:00
unittests [ValueTracking,VectorCombine] Allow passing DT to computeConstantRange. 2021-09-21 16:54:47 +01:00
utils [gn build] Port a04a6ce772 2021-09-21 16:34:07 +00:00
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt [cmake] Put check from D110016 behind (default-on) flag 2021-09-20 15:09:05 -04:00
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

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.