-
Notifications
You must be signed in to change notification settings - Fork 14.3k
AMDGPU: Use reportFatalUsageError in AMDGPULowerBufferFatPointers #145132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
arsenm
merged 1 commit into
main
from
users/arsenm/amdgpu/use-reportFatalUsageError-AMDGPULowerBufferFatPointers
Jun 21, 2025
Merged
AMDGPU: Use reportFatalUsageError in AMDGPULowerBufferFatPointers #145132
arsenm
merged 1 commit into
main
from
users/arsenm/amdgpu/use-reportFatalUsageError-AMDGPULowerBufferFatPointers
Jun 21, 2025
+26
−21
Conversation
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
@llvm/pr-subscribers-backend-amdgpu Author: Matt Arsenault (arsenm) ChangesFull diff: https://github.com/llvm/llvm-project/pull/145132.diff 1 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/AMDGPULowerBufferFatPointers.cpp b/llvm/lib/Target/AMDGPU/AMDGPULowerBufferFatPointers.cpp
index 67db961e60fa3..fa8af68817dfc 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULowerBufferFatPointers.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULowerBufferFatPointers.cpp
@@ -624,7 +624,7 @@ bool StoreFatPtrsAsIntsAndExpandMemcpyVisitor::visitMemMoveInst(
if (MMI.getSourceAddressSpace() != AMDGPUAS::BUFFER_FAT_POINTER &&
MMI.getDestAddressSpace() != AMDGPUAS::BUFFER_FAT_POINTER)
return false;
- report_fatal_error(
+ reportFatalUsageError(
"memmove() on buffer descriptors is not implemented because pointer "
"comparison on buffer descriptors isn't implemented\n");
}
@@ -738,10 +738,10 @@ Type *LegalizeBufferContentTypesVisitor::scalarArrayTypeAsVector(Type *T) {
return T;
Type *ET = AT->getElementType();
if (!ET->isSingleValueType() || isa<VectorType>(ET))
- report_fatal_error("loading non-scalar arrays from buffer fat pointers "
- "should have recursed");
+ reportFatalUsageError("loading non-scalar arrays from buffer fat pointers "
+ "should have recursed");
if (!DL.typeSizeEqualsStoreSize(AT))
- report_fatal_error(
+ reportFatalUsageError(
"loading padded arrays from buffer fat pinters should have recursed");
return FixedVectorType::get(ET, AT->getNumElements());
}
@@ -1259,12 +1259,13 @@ Constant *FatPtrConstMaterializer::materializeBufferFatPtrConst(Constant *C) {
}
if (isa<GlobalValue>(C))
- report_fatal_error("Global values containing ptr addrspace(7) (buffer "
- "fat pointer) values are not supported");
+ reportFatalUsageError("global values containing ptr addrspace(7) (buffer "
+ "fat pointer) values are not supported");
if (isa<ConstantExpr>(C))
- report_fatal_error("Constant exprs containing ptr addrspace(7) (buffer "
- "fat pointer) values should have been expanded earlier");
+ reportFatalUsageError(
+ "constant exprs containing ptr addrspace(7) (buffer "
+ "fat pointer) values should have been expanded earlier");
return nullptr;
}
@@ -1744,28 +1745,32 @@ Value *SplitPtrStructs::handleMemoryInst(Instruction *I, Value *Arg, Value *Ptr,
IID = Intrinsic::amdgcn_raw_ptr_buffer_atomic_fmin;
break;
case AtomicRMWInst::FSub: {
- report_fatal_error("atomic floating point subtraction not supported for "
- "buffer resources and should've been expanded away");
+ reportFatalUsageError(
+ "atomic floating point subtraction not supported for "
+ "buffer resources and should've been expanded away");
break;
}
case AtomicRMWInst::FMaximum: {
- report_fatal_error("atomic floating point fmaximum not supported for "
- "buffer resources and should've been expanded away");
+ reportFatalUsageError(
+ "atomic floating point fmaximum not supported for "
+ "buffer resources and should've been expanded away");
break;
}
case AtomicRMWInst::FMinimum: {
- report_fatal_error("atomic floating point fminimum not supported for "
- "buffer resources and should've been expanded away");
+ reportFatalUsageError(
+ "atomic floating point fminimum not supported for "
+ "buffer resources and should've been expanded away");
break;
}
case AtomicRMWInst::Nand:
- report_fatal_error("atomic nand not supported for buffer resources and "
- "should've been expanded away");
+ reportFatalUsageError(
+ "atomic nand not supported for buffer resources and "
+ "should've been expanded away");
break;
case AtomicRMWInst::UIncWrap:
case AtomicRMWInst::UDecWrap:
- report_fatal_error("wrapping increment/decrement not supported for "
- "buffer resources and should've ben expanded away");
+ reportFatalUsageError("wrapping increment/decrement not supported for "
+ "buffer resources and should've ben expanded away");
break;
case AtomicRMWInst::BAD_BINOP:
llvm_unreachable("Not sure how we got a bad binop");
@@ -2019,7 +2024,7 @@ PtrParts SplitPtrStructs::visitAddrSpaceCastInst(AddrSpaceCastInst &I) {
}
if (I.getSrcAddressSpace() != AMDGPUAS::BUFFER_RESOURCE)
- report_fatal_error(
+ reportFatalUsageError(
"only buffer resources (addrspace 8) and null/poison pointers can be "
"cast to buffer fat pointers (addrspace 7)");
SplitUsers.insert(&I);
@@ -2225,8 +2230,8 @@ PtrParts SplitPtrStructs::visitIntrinsicInst(IntrinsicInst &I) {
IRB.SetInsertPoint(&I);
auto [Rsrc, Off] = getPtrParts(Ptr);
if (Mask->getType() != Off->getType())
- report_fatal_error("offset width is not equal to index width of fat "
- "pointer (data layout not set up correctly?)");
+ reportFatalUsageError("offset width is not equal to index width of fat "
+ "pointer (data layout not set up correctly?)");
Value *OffRes = IRB.CreateAnd(Off, Mask, I.getName() + ".off");
copyMetadata(OffRes, &I);
SplitUsers.insert(&I);
|
krzysz00
approved these changes
Jun 21, 2025
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.
No description provided.