[llvm] [AIX] Support per global code model. (PR #79202)
Chen Zheng via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 10 21:29:06 PDT 2024
================
@@ -0,0 +1,137 @@
+; RUN: llc --verify-machineinstrs -mtriple powerpc-ibm-aix --code-model=small < \
+; RUN: %s | FileCheck --check-prefixes=CHECK,CHECK32,CHECK-SMALL,CHECK-SMALL32 %s
+
+; RUN: llc --verify-machineinstrs -mtriple powerpc-ibm-aix --code-model=large < \
+; RUN: %s | FileCheck --check-prefixes=CHECK,CHECK32,CHECK-LARGE,CHECK-LARGE32 %s
+
+; RUN: llc --verify-machineinstrs -mtriple powerpc64-ibm-aix --code-model=small < \
+; RUN: %s | FileCheck --check-prefixes=CHECK,CHECK64,CHECK-SMALL,CHECK-SMALL64 %s
+
+; RUN: llc --verify-machineinstrs -mtriple powerpc64-ibm-aix --code-model=large < \
+; RUN: %s | FileCheck --check-prefixes=CHECK,CHECK64,CHECK-LARGE,CHECK-LARGE64 %s
+
+ at a = external dso_local global i32, code_model "small", align 4
+ at b = external dso_local global i32, code_model "large", align 4
+ at c = dso_local global i32 55, code_model "small", align 4
+ at d = dso_local global i32 41, code_model "large", align 4
+ at e = external dso_local global i32, align 4
+ at f = dso_local global i32 2748, align 4
----------------
chenzheng1030 wrote:
Can we add an `alias` case. So that the alias symbol also respect the code model of its aliasee global variable?
```
@var = global i32 42, code_model "large", align 4
@var1 = alias i32, ptr @var
define i32 @fun() {
%tmp = load i32, ptr @var1
ret i32 %tmp
}
````
https://github.com/llvm/llvm-project/pull/79202
More information about the llvm-commits
mailing list