Skip to content

Commit 3cb7e72

Browse files
committed
[AMDGPU] Fix a potential wrong return value indicating whether a pass modifies a function
When the alloca is too big for vectorization, the function could have already been modified in previous iteration of the `for` loop.
1 parent 4bc4c7b commit 3cb7e72

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ bool AMDGPUPromoteAllocaImpl::run(Function &F, bool PromoteToLDS) {
336336
if (AllocaCost > VectorizationBudget) {
337337
LLVM_DEBUG(dbgs() << " Alloca too big for vectorization: " << *AI
338338
<< "\n");
339-
return false;
339+
return Changed;
340340
}
341341

342342
if (tryPromoteAllocaToVector(*AI)) {

0 commit comments

Comments
 (0)