aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
diff options
context:
space:
mode:
authorDiana Picus <Diana-Magda.Picus@amd.com>2025-04-25 11:29:27 +0200
committerGitHub <noreply@github.com>2025-04-25 11:29:27 +0200
commit5bad5d84a15a4f36b8ed5b33dde924683bcc9ea1 (patch)
tree1d30caada34ceef9bae83c3895cdc7df0495d525 /clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
parent211b51e4713d814d6fa894f4fc309a364c5642ce (diff)
downloadllvm-5bad5d84a15a4f36b8ed5b33dde924683bcc9ea1.zip
llvm-5bad5d84a15a4f36b8ed5b33dde924683bcc9ea1.tar.gz
llvm-5bad5d84a15a4f36b8ed5b33dde924683bcc9ea1.tar.bz2
Reland [AMDGPU] Support block load/store for CSR #130013 (#137169)
Add support for using the existing SCRATCH_STORE_BLOCK and SCRATCH_LOAD_BLOCK instructions for saving and restoring callee-saved VGPRs. This is controlled by a new subtarget feature, block-vgpr-csr. It does not include WWM registers - those will be saved and restored individually, just like before. This patch does not change the ABI. Use of this feature may lead to slightly increased stack usage, because the memory is not compacted if certain registers don't have to be transferred (this will happen in practice for calling conventions where the callee and caller saved registers are interleaved in groups of 8). However, if the registers at the end of the block of 32 don't have to be transferred, we don't need to use a whole 128-byte stack slot - we can trim some space off the end of the range. In order to implement this feature, we need to rely less on the target-independent code in the PrologEpilogInserter, so we override several new methods in SIFrameLowering. We also add new pseudos, SI_BLOCK_SPILL_V1024_SAVE/RESTORE. One peculiarity is that both the SI_BLOCK_V1024_RESTORE pseudo and the SCRATCH_LOAD_BLOCK instructions will have all the registers that are not transferred added as implicit uses. This is done in order to inform LiveRegUnits that those registers are not available before the restore (since we're not really restoring them - so we can't afford to scavenge them). Unfortunately, this trick doesn't work with the save, so before the save all the registers in the block will be unavailable (see the unit test). This was reverted due to failures in the builds with expensive checks on, now fixed by always updating LiveIntervals and SlotIndexes in SILowerSGPRSpills.
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp')
0 files changed, 0 insertions, 0 deletions