diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp --- a/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp @@ -397,7 +397,10 @@ } } - NeedsQueuePtr |= checkForQueuePtr(A); + if (!NeedsQueuePtr) { + NeedsQueuePtr = checkForQueuePtr(A); + } + if (NeedsQueuePtr) { removeAssumedBits(QUEUE_PTR); }