[llvm] [PowerPC] Do not string pool globals that are part of llvm used. (PR #66848)

Lei Huang via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 09:18:27 PST 2023


================
@@ -0,0 +1,57 @@
+;; Test that the string pooling pass does not pool globals that are
+;; in llvm.used or in llvm.compiler.used.
+
+; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mtriple powerpc-ibm-aix-xcoff -data-sections=false < %s | \
+; RUN:   FileCheck %s
+
+; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mtriple powerpc64-ibm-aix-xcoff -data-sections=false < %s | \
+; RUN:   FileCheck %s
+
+ at keep_this = internal constant [5 x i8] c"keep1", align 1
+ at keep_this2 = internal constant [5 x i8] c"keep2", align 1
+ at .str.1 = private unnamed_addr constant [12 x i8] c"str1_STRING\00", align 1
+ at .str.2 = private unnamed_addr constant [12 x i8] c"str2_STRING\00", align 1
+ at .str.3 = private unnamed_addr constant [12 x i8] c"str3_STRING\00", align 1
+ at llvm.used = appending global [1 x ptr] [ptr @keep_this], section "llvm.metadata"
+ at llvm.compiler.used = appending global [1 x ptr] [ptr @keep_this2], section "llvm.metadata"
+
+declare signext i32 @callee(ptr noundef) local_unnamed_addr
----------------
lei137 wrote:

I don't think `local_unnamed_addr` does anything here does it?   If not can we remove that and the `#0` from blow.  Thx

https://github.com/llvm/llvm-project/pull/66848


More information about the llvm-commits mailing list