[llvm] 100319c - [AIX] follow-up of D124654.

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 00:39:37 PDT 2022


Author: esmeyi
Date: 2022-07-13T03:39:08-04:00
New Revision: 100319cdb4f7194707a885e456a0dbb2a2ffd02e

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

LOG: [AIX] follow-up of D124654.
Report an error when alias symbols are not emitted all.

Added: 
    llvm/test/CodeGen/PowerPC/aix-alias-alignment-3.ll

Modified: 
    llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 64ce270722c9e..94612a51d2e1f 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -3357,6 +3357,11 @@ void AsmPrinter::emitGlobalConstant(const DataLayout &DL, const Constant *CV,
     // look like they are at the same location.
     OutStreamer->emitIntValue(0, 1);
   }
+  if (!AliasList)
+    return;
+  for (const auto &AliasPair : *AliasList)
+    report_fatal_error("Aliases with offset " + Twine(AliasPair.first) +
+                       " were not emitted.");
 }
 
 void AsmPrinter::emitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) {

diff  --git a/llvm/test/CodeGen/PowerPC/aix-alias-alignment-3.ll b/llvm/test/CodeGen/PowerPC/aix-alias-alignment-3.ll
new file mode 100644
index 0000000000000..7934638e3f0cc
--- /dev/null
+++ b/llvm/test/CodeGen/PowerPC/aix-alias-alignment-3.ll
@@ -0,0 +1,8 @@
+;; TODO: The alias offset doesn't refer to any sub-element.
+; RUN: not --crash llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
+; RUN:     -data-sections=false < %s 2>&1 | FileCheck --check-prefix=ERROR %s
+
+; ERROR: Aliases with offset 1 were not emitted.
+
+ at ConstVector = global <2 x i64> <i64 1, i64 2>
+ at var = alias i64, getelementptr inbounds (i8, ptr @ConstVector, i32 1)


        


More information about the llvm-commits mailing list