Skip to content

Commit 1f77682

Browse files
committed
nikic's suggestion
1 parent fdb520a commit 1f77682

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3692,6 +3692,10 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) {
36923692
} else {
36933693
Results.push_back(DAG.getUNDEF(Node->getValueType(0)));
36943694
Results.push_back(Node->getOperand(0));
3695+
3696+
DAG.getContext()->diagnose(DiagnosticInfoLegalizationFailure(
3697+
Node->getOperationName(&DAG) + " is not supported on this target.",
3698+
DAG.getMachineFunction().getFunction(), dl.getDebugLoc()));
36953699
}
36963700
break;
36973701
case ISD::STACKRESTORE:
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
; RUN: not llc < %s -mtriple nvptx 2>&1 | FileCheck %s
2+
3+
declare ptr @llvm.stackaddress.p0()
4+
5+
define ptr @test() {
6+
; CHECK: STACKADDRESS is not supported on this target.
7+
%sp = call ptr @llvm.stackaddress.p0()
8+
ret ptr %sp
9+
}

0 commit comments

Comments
 (0)