[PATCH] D134582: [LoongArch] Support lowering frames larger than 2048 bytes

Lu Weining via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 05:27:49 PDT 2022


SixWeining added a comment.

LGTM. Thanks. Others may also have a look.



================
Comment at: llvm/test/CodeGen/LoongArch/frame.ll:42-64
+define void @test_large_frame_size_2032(ptr byval(%size2016) %x) {
+; CHECK-LABEL: test_large_frame_size_2032:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    addi.d $sp, $sp, -2032
+; CHECK-NEXT:    .cfi_def_cfa_offset 2032
+; CHECK-NEXT:    st.d $ra, $sp, 2024 # 8-byte Folded Spill
+; CHECK-NEXT:    st.d $fp, $sp, 2016 # 8-byte Folded Spill
----------------
xen0n wrote:
> SixWeining wrote:
> > How about this IR which is simpler:
> > 
> > ```
> > define void @test_large_frame_size_2032() {
> > ; CHECK-LABEL: test_large_frame_size_2032:
> > ; CHECK:       # %bb.0:
> > ; CHECK-NEXT:    addi.d $sp, $sp, -2032
> > ; CHECK-NEXT:    .cfi_def_cfa_offset 2032
> > ; CHECK-NEXT:    addi.d $sp, $sp, 2032
> > ; CHECK-NEXT:    ret
> >   %1 = alloca i8, i32 2032
> >   ret void
> > }
> > ```
> Thanks for the suggestion; I adapted `CodeGen/Generic/2010-11-04-BigByval.ll` which also happened to expose the suboptimal codegen. Your version is simpler and focuses solely on the frame size handling, which I'll take. Thanks.
Thanks for the quick update. :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134582/new/

https://reviews.llvm.org/D134582



More information about the llvm-commits mailing list