[PATCH] D156012: [NVPTX] Fix lack of `.noreturn` on certain functions for aliases
Joseph Huber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 24 05:01:30 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6a51997ccc23: [NVPTX] Fix lack of `.noreturn` on certain functions for aliases (authored by jhuber6).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156012/new/
https://reviews.llvm.org/D156012
Files:
llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
llvm/test/CodeGen/NVPTX/alias.ll
Index: llvm/test/CodeGen/NVPTX/alias.ll
===================================================================
--- llvm/test/CodeGen/NVPTX/alias.ll
+++ llvm/test/CodeGen/NVPTX/alias.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=nvptx64 -mcpu=sm_30 -mattr=+ptx63 | FileCheck %s
+; RUN: llc < %s -march=nvptx64 -mcpu=sm_30 -mattr=+ptx64 | FileCheck %s
define i32 @a() { ret i32 0 }
@b = internal alias i32 (), ptr @a
@@ -7,6 +7,13 @@
define void @foo(i32 %0, ptr %1) { ret void }
@bar = alias i32 (), ptr @foo
+define void @noreturn() #0 {
+ ret void
+}
+ at noreturn_alias = alias i32 (), ptr @noreturn
+
+attributes #0 = { noreturn }
+
; CHECK: .visible .func (.param .b32 func_retval0) a()
; CHECK: .visible .func foo(
@@ -14,6 +21,9 @@
; CHECK-NEXT: .param .b64 foo_param_1
; CHECK-NEXT: )
+; CHECK: .visible .func noreturn()
+; CHECK-NEXT: .noreturn
+
; CHECK: .visible .func (.param .b32 func_retval0) b();
; CHECK-NEXT: .alias b, a;
@@ -25,3 +35,7 @@
; CHECK-NEXT: .param .b64 foo_param_1
; CHECK-NEXT: );
; CHECK-NEXT: .alias bar, foo;
+
+; CHECK: .visible .func noreturn_alias()
+; CHECK-NEXT: .noreturn;
+; CHECK-NEXT: .alias noreturn_alias, noreturn;
Index: llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
===================================================================
--- llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
+++ llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
@@ -873,6 +873,8 @@
printReturnValStr(F, OS);
OS << Name->getName();
emitFunctionParamList(F, OS);
+ if (shouldEmitPTXNoReturn(F, TM))
+ OS << "\n.noreturn";
OS << ";\n";
OS << ".alias " << Name->getName() << ", " << F->getName() << ";\n";
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156012.543474.patch
Type: text/x-patch
Size: 1683 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230724/cc865937/attachment.bin>
More information about the llvm-commits
mailing list