[PATCH] D131954: [LoongArch] Support Load and Store with 14-bit signed immediate operands

WÁNG Xuěruì via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 17 19:15:11 PDT 2022


xen0n added a comment.

In general you should name the testcases after your intent. For example for the `getelementptr ..., 255` case it's evident you want to check `{ld,st}ptr` is not emitted for misaligned offsets, and for `getelementptr ..., 4096` case you seem to be checking `{ld,st}ptr` is not emitted for out-of-range offsets. So names like `ldptr_w`, `ldptr_w_misaligned_offset` or `ldptr_w_too_big_offset` could be better conveying the intent.

Otherwise LGTM.



================
Comment at: llvm/lib/Target/LoongArch/LoongArchInstrInfo.td:952
+          (LDPTR_W BaseAddr:$rj, simm14_lsl2:$imm14)>;
+def : Pat<(i64 (load (AddLike BaseAddr:$rj, simm14_lsl2:$imm14))),
+          (LDPTR_D BaseAddr:$rj, simm14_lsl2:$imm14)>;
----------------
I'm not sure if these `AddLike`'s could be simplified into plain `add`.

@wangleiat any opinion?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131954



More information about the llvm-commits mailing list