[llvm] Limit Alloca->LDS promotion based on speculations as to eventual register pressure (PR #152814)
Patrick Simmons via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 11 12:55:26 PDT 2025
================
@@ -1471,9 +1485,83 @@ bool AMDGPUPromoteAllocaImpl::hasSufficientLocalMem(const Function &F) {
return true;
}
+size_t AMDGPUPromoteAllocaImpl::getSGPRPressureEstimate(AllocaInst &I) {
+ Function &F = *I.getParent()->getParent();
+ size_t MaxLive = 0;
+ for (BasicBlock *BB : post_order(&F)) {
+ if (SGPRLiveIns.count(BB))
----------------
linuxrocks123 wrote:
This is semantically opposite of what is required, and that function does not exist until C++20. LLVM compiles under the C++17 standard.
https://github.com/llvm/llvm-project/pull/152814
More information about the llvm-commits
mailing list