Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3692,6 +3692,10 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) {
} else {
Results.push_back(DAG.getUNDEF(Node->getValueType(0)));
Results.push_back(Node->getOperand(0));

DAG.getContext()->diagnose(DiagnosticInfoLegalizationFailure(
Node->getOperationName(&DAG) + " is not supported on this target.",
DAG.getMachineFunction().getFunction(), dl.getDebugLoc()));
}
break;
case ISD::STACKRESTORE:
Expand Down
9 changes: 9 additions & 0 deletions llvm/test/CodeGen/NVPTX/stackaddress.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
; RUN: not llc < %s -mtriple nvptx 2>&1 | FileCheck %s

declare ptr @llvm.stackaddress.p0()

define ptr @test() {
; CHECK: STACKADDRESS is not supported on this target.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the error: prefix with location

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should also refer to the intrinsic by name, not the DAG operation. We're not consistent on this, but at least in this case it will always directly map back to the intrinsic

Copy link
Contributor Author

@moorabbit moorabbit Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the error: prefix with location

Fixed.
Let me know if you want me to update the test case with a valid debug location instead of <unknown>:0:0.

Probably should also refer to the intrinsic by name, not the DAG operation.

Fixed.
We report the name of the intrinsic now in the error message.

Thx.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping.

%sp = call ptr @llvm.stackaddress.p0()
ret ptr %sp
}