[llvm] 1e30185 - [SystemZ] Add serialization strings for some MO target flags. (#203053)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 23 03:21:07 PDT 2026
Author: Jonas Paulsson
Date: 2026-06-23T12:21:03+02:00
New Revision: 1e3018523042d1b610b6676cf8d056315f6e3bd7
URL: https://github.com/llvm/llvm-project/commit/1e3018523042d1b610b6676cf8d056315f6e3bd7
DIFF: https://github.com/llvm/llvm-project/commit/1e3018523042d1b610b6676cf8d056315f6e3bd7.diff
LOG: [SystemZ] Add serialization strings for some MO target flags. (#203053)
These strings are needed for MIR textual representation: If one is
missing it doesn't work to do "-stop-before=XXX and then
-start-before=XXX".
Added:
llvm/test/CodeGen/SystemZ/target-flags.ll
Modified:
llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp b/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
index c16da52d09e62..d5bdb8ef3b595 100644
--- a/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
@@ -2424,6 +2424,8 @@ SystemZInstrInfo::getSerializableDirectMachineOperandTargetFlags() const {
using namespace SystemZII;
static const std::pair<unsigned, const char *> TargetFlags[] = {
+ {MO_GOT, "systemz-got"},
+ {MO_INDNTPOFF, "systemz-indntpoff"},
{MO_ADA_DATA_SYMBOL_ADDR, "systemz-ada-datasymboladdr"},
{MO_ADA_INDIRECT_FUNC_DESC, "systemz-ada-indirectfuncdesc"},
{MO_ADA_DIRECT_FUNC_DESC, "systemz-ada-directfuncdesc"}};
diff --git a/llvm/test/CodeGen/SystemZ/target-flags.ll b/llvm/test/CodeGen/SystemZ/target-flags.ll
new file mode 100644
index 0000000000000..e25c8972fb263
--- /dev/null
+++ b/llvm/test/CodeGen/SystemZ/target-flags.ll
@@ -0,0 +1,14 @@
+; RUN: llc -mtriple=s390x-linux-gnu -stop-after=systemz-isel --simplify-mir < %s | FileCheck %s
+
+ at G = external global i64
+define i64 @fun0() {
+; CHECK: %{{.*}}:addr64bit = LGRL target-flags(systemz-got) @G
+ %Res = load i64, ptr @G
+ ret i64 %Res
+}
+
+ at x = thread_local(initialexec) global i32 0
+define ptr at fun1() {
+; CHECK: %{{.*}}:addr64bit = LARL target-flags(systemz-indntpoff) @x
+ ret ptr at x
+}
More information about the llvm-commits
mailing list