[llvm] [PowerPC] 32-bit large code-model support for toc-data (PR #85129)

Chen Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 21 01:03:49 PDT 2024


================
@@ -44,6 +52,15 @@ define dso_local void @write_int(i32 signext %in) {
 ; TEST64:           la 4, i[TD](2)
 ; TEST64-NEXT:      stw 3, 0(4)
 
+; CHECK32LARGE: name:            write_int
+; CHECK32LARGE:      %[[SCRATCH1:[0-9]+]]:gprc_and_gprc_nor0 = ADDIStocHA $r2, @i
+; CHECK32LARGE-NEXT: %[[SCRATCH2:[0-9]+]]:gprc_and_gprc_nor0 = ADDItocL killed %[[SCRATCH1]], @i
+; CHECK32LARGE-NEXT: STW %{{[0-9]+}}, 0, killed %[[SCRATCH2]] :: (store (s32) into @i)
+
+; TEST32LARGE:         .write_int:
+; TEST32LARGE:          addis 4, i[TD]@u(2)
+; TEST32LARGE-NEXT:	la 4, i[TD]@l(4)
----------------
chenzheng1030 wrote:

Not related to this patch, here we should have a peephole opportunity that we can add the lower part relocation `@l` to the consuming `stw`?

Can we add a fixme here? We are trying to improve the code generation for toc-data at small code model in https://github.com/llvm/llvm-project/pull/76488 . But seems we also have the opportunity for the large model.

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


More information about the llvm-commits mailing list