[AMDGPU] Assert non-array alloca does have a size - #183834
Merged
Merged
Conversation
Member
|
@llvm/pr-subscribers-backend-amdgpu Author: Jameson Nash (vtjnash) ChangesRefs https://github.com/llvm/llvm-project/pull/179523/changes#r2851952141 Full diff: https://github.com/llvm/llvm-project/pull/183834.diff 1 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
index 9e31bb51226f8..3225bd34201c3 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
@@ -423,8 +423,7 @@ bool AMDGPUPromoteAllocaImpl::run(Function &F, bool PromoteToLDS) {
for (AllocaAnalysis &AA : Allocas) {
if (AA.Vector.Ty) {
std::optional<TypeSize> Size = AA.Alloca->getAllocationSize(*DL);
- if (!Size)
- continue; // Skip dynamic allocas
+ assert(Size); // expected to succeed on non-array alloca
const unsigned AllocaCost = Size->getFixedValue() * 8;
// First, check if we have enough budget to vectorize this alloca.
if (AllocaCost <= VectorizationBudget) {
|
arsenm
approved these changes
Feb 27, 2026
| @@ -423,8 +423,7 @@ bool AMDGPUPromoteAllocaImpl::run(Function &F, bool PromoteToLDS) { | |||
| for (AllocaAnalysis &AA : Allocas) { | |||
| if (AA.Vector.Ty) { | |||
| std::optional<TypeSize> Size = AA.Alloca->getAllocationSize(*DL); | |||
| if (!Size) | |||
| continue; // Skip dynamic allocas | |||
| assert(Size); // expected to succeed on non-array alloca | |||
vtjnash
force-pushed
the
jn/less-getAllocatedType-Target-1b
branch
from
February 27, 2026 21:24
225ea6d to
83fffa6
Compare
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/88/builds/20950 Here is the relevant piece of the build log for the reference |
sahas3
pushed a commit
to sahas3/llvm-project
that referenced
this pull request
Mar 4, 2026
sujianIBM
pushed a commit
to sujianIBM/llvm-project
that referenced
this pull request
Mar 5, 2026
This was referenced Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs https://github.com/llvm/llvm-project/pull/179523/changes#r2851952141