[llvm] AMDGPU: Avoid report_fatal_error in image intrinsic lowering (PR #145201)
Sebastian Neubauer via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 25 04:23:24 PDT 2025
================
@@ -8703,9 +8707,23 @@ SDValue SITargetLowering::lowerImage(SDValue Op,
if (Subtarget->hasGFX90AInsts()) {
Opcode = AMDGPU::getMIMGOpcode(IntrOpcode, AMDGPU::MIMGEncGfx90a,
NumVDataDwords, NumVAddrDwords);
- if (Opcode == -1)
- report_fatal_error(
- "requested image instruction is not supported on this GPU");
+ if (Opcode == -1) {
+ DAG.getContext()->diagnose(DiagnosticInfoUnsupported(
+ DAG.getMachineFunction().getFunction(),
+ "requested image instruction is not supported on this GPU",
+ DL.getDebugLoc()));
+
+ unsigned Idx = 0;
+ SmallVector<SDValue, 3> RetValues(OrigResultTypes.size());
+ for (EVT VT : OrigResultTypes) {
----------------
Flakebi wrote:
Could probably use enumerate?
```suggestion
for (auto [Idx, VT] : llvm::enumerate(OrigResultTypes)) {
```
https://github.com/llvm/llvm-project/pull/145201
More information about the llvm-commits
mailing list