[llvm] 339392e - [AIX] follow-up of D124654.

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 20 22:14:05 PDT 2022


Author: esmeyi
Date: 2022-07-21T01:10:09-04:00
New Revision: 339392ecf25d75fb9b448c38c5bbb48764aa06a4

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

LOG: [AIX] follow-up of D124654.
Emitting the remaining aliases instead of reporting
an error to avoid SPEC2017 PEAK failures.
And mark this as a TODO.

Added: 
    

Modified: 
    llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    llvm/test/CodeGen/PowerPC/aix-alias-alignment-3.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 051e5cfeea0f..241af0800dcb 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -3359,9 +3359,12 @@ void AsmPrinter::emitGlobalConstant(const DataLayout &DL, const Constant *CV,
   }
   if (!AliasList)
     return;
-  for (const auto &AliasPair : *AliasList)
-    report_fatal_error("Aliases with offset " + Twine(AliasPair.first) +
-                       " were not emitted.");
+  // TODO: These remaining aliases are not emitted in the correct location. Need
+  // to handle the case where the alias offset doesn't refer to any sub-element.
+  for (auto &AliasPair : *AliasList) {
+    for (const GlobalAlias *GA : AliasPair.second)
+      OutStreamer->emitLabel(getSymbol(GA));
+  }
 }
 
 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
index 7934638e3f0c..74ad7266668d 100644
--- a/llvm/test/CodeGen/PowerPC/aix-alias-alignment-3.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-alias-alignment-3.ll
@@ -1,8 +1,19 @@
 ;; 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
+; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
+; RUN:     -data-sections=false < %s | FileCheck %s
 
-; ERROR: Aliases with offset 1 were not emitted.
+;; FIXME: The alias is not emitted in the correct location.
 
 @ConstVector = global <2 x i64> <i64 1, i64 2>
 @var = alias i64, getelementptr inbounds (i8, ptr @ConstVector, i32 1)
+
+; CHECK:              .csect .data[RW],4
+; CHECK-NEXT:         .globl  ConstVector                     # @ConstVector
+; CHECK-NEXT:         .globl  var
+; CHECK-NEXT:         .align  4
+; CHECK-NEXT: ConstVector:
+; CHECK-NEXT:         .vbyte  4, 0                            # 0x1
+; CHECK-NEXT:         .vbyte  4, 1
+; CHECK-NEXT:         .vbyte  4, 0                            # 0x2
+; CHECK-NEXT:         .vbyte  4, 2
+; CHECK-NEXT: var:


        


More information about the llvm-commits mailing list