AMDGPU: Stop emitting an error on illegal addrspacecasts (#127487) (#… · llvm/llvm-project@1504fc5 (original) (raw)

4 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -2426,11 +2426,8 @@ bool AMDGPULegalizerInfo::legalizeAddrSpaceCast(
2426 2426 return true;
2427 2427 }
2428 2428
2429 - DiagnosticInfoUnsupported InvalidAddrSpaceCast(
2430 - MF.getFunction(), "invalid addrspacecast", B.getDebugLoc());
2431 -
2432 - LLVMContext &Ctx = MF.getFunction().getContext();
2433 - Ctx.diagnose(InvalidAddrSpaceCast);
2429 +// Invalid casts are poison.
2430 +// TODO: Should return poison
2434 2431 B.buildUndef(Dst);
2435 2432 MI.eraseFromParent();
2436 2433 return true;
Original file line number Diff line number Diff line change
@@ -7340,11 +7340,8 @@ SDValue SITargetLowering::lowerADDRSPACECAST(SDValue Op,
7340 7340
7341 7341 // global <-> flat are no-ops and never emitted.
7342 7342
7343 - const MachineFunction &MF = DAG.getMachineFunction();
7344 - DiagnosticInfoUnsupported InvalidAddrSpaceCast(
7345 - MF.getFunction(), "invalid addrspacecast", SL.getDebugLoc());
7346 - DAG.getContext()->diagnose(InvalidAddrSpaceCast);
7347 -
7343 + // Invalid casts are poison.
7344 + // TODO: Should return poison
7348 7345 return DAG.getUNDEF(Op->getValueType(0));
7349 7346 }
7350 7347