[llvm] f624372 - [AIX][CodeGen] Renaming mroptr to xcoff-mroptr

Qiongsi Wu via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 31 07:12:12 PDT 2023


Author: Qiongsi Wu
Date: 2023-03-31T10:09:48-04:00
New Revision: f624372ccb74f455986db799f9368dec36927696

URL: https://github.com/llvm/llvm-project/commit/f624372ccb74f455986db799f9368dec36927696
DIFF: https://github.com/llvm/llvm-project/commit/f624372ccb74f455986db799f9368dec36927696.diff

LOG: [AIX][CodeGen] Renaming mroptr to xcoff-mroptr

This patch renames the `mroptr` option to `mxcoff-roptr` to indicate in the option itself that it is xcoff specific.

Reviewed By: hubert.reinterpretcast

Differential Revision: https://reviews.llvm.org/D147161

Added: 
    

Modified: 
    llvm/docs/ReleaseNotes.rst
    llvm/lib/CodeGen/CommandFlags.cpp
    llvm/test/CodeGen/PowerPC/aix-xcoff-roptr.ll
    llvm/test/CodeGen/PowerPC/aix64-xcoff-roptr.ll
    llvm/tools/llc/llc.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index 1c29ce2fbbfdd..4acb69f9327fe 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -122,9 +122,9 @@ Changes to the MIPS Backend
 Changes to the PowerPC Backend
 ------------------------------
 
-* A new option ``-mroptr`` is added to ``clang`` and ``llc``. When this option
-  is present, constant objects with relocatable address values are put into the
-  RO data section. This option should be used with the ``-fdata-sections``
+* A new option ``-mxcoff-roptr`` is added to ``clang`` and ``llc``. When this
+  option is present, constant objects with relocatable address values are put
+  into the RO data section. This option should be used with the ``-fdata-sections``
   option, and is not supported with ``-fno-data-sections``. The option is
   only supported on AIX.
 * On AIX, teach the profile runtime to check for a build-id string; such string

diff  --git a/llvm/lib/CodeGen/CommandFlags.cpp b/llvm/lib/CodeGen/CommandFlags.cpp
index 5ef650787a585..c58547d917b05 100644
--- a/llvm/lib/CodeGen/CommandFlags.cpp
+++ b/llvm/lib/CodeGen/CommandFlags.cpp
@@ -480,7 +480,7 @@ codegen::RegisterCodeGenFlags::RegisterCodeGenFlags() {
   CGBINDOPT(JMCInstrument);
 
   static cl::opt<bool> XCOFFReadOnlyPointers(
-      "mroptr",
+      "mxcoff-roptr",
       cl::desc("When set to true, const objects with relocatable address "
                "values are put into the RO data section."),
       cl::init(false));

diff  --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-roptr.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-roptr.ll
index 532d17e087e5b..6365b3a74e066 100644
--- a/llvm/test/CodeGen/PowerPC/aix-xcoff-roptr.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-roptr.ll
@@ -1,11 +1,11 @@
-; RUN: llc -mtriple powerpc-ibm-aix-xcoff -mroptr < %s | FileCheck %s
-; RUN: llc -mtriple powerpc-ibm-aix-xcoff -mroptr -filetype=obj -o %t.o < %s
+; RUN: llc -mtriple powerpc-ibm-aix-xcoff -mxcoff-roptr < %s | FileCheck %s
+; RUN: llc -mtriple powerpc-ibm-aix-xcoff -mxcoff-roptr -filetype=obj -o %t.o < %s
 ; RUN: llvm-objdump -t --symbol-description %t.o | FileCheck %s --check-prefix=OBJ
 
-; RUN: not llc -mtriple powerpc-ibm-aix-xcoff -mroptr -data-sections=false \
+; RUN: not llc -mtriple powerpc-ibm-aix-xcoff -mxcoff-roptr -data-sections=false \
 ; RUN: < %s 2>&1 | FileCheck %s --check-prefix=DS_ERR
 
-; DS_ERR: -mroptr option must be used with -data-sections
+; DS_ERR: -mxcoff-roptr option must be used with -data-sections
 
 %union.U = type { %"struct.U::A" }
 %"struct.U::A" = type { ptr }

diff  --git a/llvm/test/CodeGen/PowerPC/aix64-xcoff-roptr.ll b/llvm/test/CodeGen/PowerPC/aix64-xcoff-roptr.ll
index aff753661b0e1..ef937ea7f0bae 100644
--- a/llvm/test/CodeGen/PowerPC/aix64-xcoff-roptr.ll
+++ b/llvm/test/CodeGen/PowerPC/aix64-xcoff-roptr.ll
@@ -1,14 +1,14 @@
-; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -mroptr < %s | FileCheck %s
-; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -mroptr -filetype=obj -o %t.o < %s
+; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -mxcoff-roptr < %s | FileCheck %s
+; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -mxcoff-roptr -filetype=obj -o %t.o < %s
 ; RUN: llvm-objdump -t --symbol-description %t.o | FileCheck %s --check-prefix=OBJ
 
-; RUN: not llc -mtriple powerpc64-ibm-aix-xcoff -mroptr -data-sections=false \
+; RUN: not llc -mtriple powerpc64-ibm-aix-xcoff -mxcoff-roptr -data-sections=false \
 ; RUN: < %s 2>&1 | FileCheck %s --check-prefix=DS_ERR
-; RUN: not llc -mtriple powerpc64le-unknown-linux-gnu -mroptr \
+; RUN: not llc -mtriple powerpc64le-unknown-linux-gnu -mxcoff-roptr \
 ; RUN: < %s 2>&1 | FileCheck %s --check-prefix=OS_ERR
 
-; DS_ERR: -mroptr option must be used with -data-sections
-; OS_ERR: -mroptr option is only supported on AIX
+; DS_ERR: -mxcoff-roptr option must be used with -data-sections
+; OS_ERR: -mxcoff-roptr option is only supported on AIX
 
 %union.U = type { %"struct.U::A" }
 %"struct.U::A" = type { ptr }

diff  --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp
index 860fa39d57e8a..0764968b4c22c 100644
--- a/llvm/tools/llc/llc.cpp
+++ b/llvm/tools/llc/llc.cpp
@@ -499,7 +499,8 @@ static int compileModule(char **argv, LLVMContext &Context) {
 
     if (Options.XCOFFReadOnlyPointers) {
       if (!TheTriple.isOSAIX())
-        reportError("-mroptr option is only supported on AIX", InputFilename);
+        reportError("-mxcoff-roptr option is only supported on AIX",
+                    InputFilename);
 
       // Since the storage mapping class is specified per csect,
       // without using data sections, it is less effective to use read-only
@@ -510,7 +511,7 @@ static int compileModule(char **argv, LLVMContext &Context) {
       // since we have not found reasons to do otherwise that overcome the user
       // surprise of not respecting the setting.
       if (!Options.DataSections)
-        reportError("-mroptr option must be used with -data-sections",
+        reportError("-mxcoff-roptr option must be used with -data-sections",
                     InputFilename);
     }
 


        


More information about the llvm-commits mailing list