[llvm] [AIX] Support per global code model. (PR #79202)

Sean Fertile via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 12:57:56 PST 2024


================
@@ -58,6 +59,32 @@ entry:
 ; CHECK: lwz 3, 0([[ADDR]])
 ; CHECK: blr
 
+define i32 @E() {
+entry:
+  %0 = load i32, ptr @e, align 4
+  ret i32 %0
+}
+; CHECK-LARGE: addis [[HI:[0-9]+]], L..C[[TL_E:[0-9]+]]@u(2)
+; CHECK-LARGE32: lwz [[SCRATCH:[0-9]+]], L..C[[TL_E]]@l([[HI]])
+; CHECK-SMALL32: lwz [[SCRATCH:[0-9]+]], L..C[[TL_E:[0-9]+]](2)
+; CHECK-LARGE64: ld  [[SCRATCH:[0-9]+]], L..C[[TL_E]]@l([[HI]])
+; CHECK-SMALL64: ld  [[SCRATCH:[0-9]+]], L..C[[TL_E:[0-9]+]](2)
+; CHECK: lwz 3, 0([[SCRATCH]])
+; CHECK: blr
+
+define i32 @F() {
+entry:
+  %0 = load i32, ptr @f, align 4
+  ret i32 %0
+}
+; CHECK-LARGE: addis [[HI:[0-9]+]], L..C[[TL_F:[0-9]+]]@u(2)
+; CHECK-LARGE32: lwz [[SCRATCH:[0-9]+]], L..C[[TL_F]]@l([[HI]])
+; CHECK-SMALL32: lwz [[SCRATCH:[0-9]+]], L..C[[TL_F:[0-9]+]](2)
+; CHECK-LARGE64: ld [[SCRATCH:[0-9]+]], L..C[[TL_F]]@l([[HI]])
+; CHECK-SMALL64: ld  [[SCRATCH:[0-9]+]], L..C[[TL_F:[0-9]+]](2)
+; CHECK: lwz 3, 0([[SCRATCH]])
----------------
mandlebug wrote:

I like the suggestion in that it simplifies the number of check prefixes we have, but then it also buries some of the details behind the macro. I was looking at the difference in the toc peephole patch (since the testing there seems to have gone from using the macro to now using it) and personally prefer having the extra check but easier to read output - mainly because we are already impacting the readability by having to have match variables for the labels in the TOC. If you feel really strongly let me know and I will change it over to your suggestion.

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


More information about the llvm-commits mailing list