[PATCH] D140804: [BPF] support for BPF_ST instruction in codegen

Yonghong Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 4 19:56:31 PDT 2023


yonghong-song accepted this revision.
yonghong-song added a comment.
This revision is now accepted and ready to land.

LGTM except a few nits!



================
Comment at: llvm/lib/Target/BPF/BPFInstrInfo.td:483
+}
+  
+let Predicates = [BPFHasStoreImm] in {
----------------
Extra space (' ') char here.


================
Comment at: llvm/lib/Target/BPF/BPFInstrInfo.td:488
+  // when immediate is -1, but it is incorrect to generate such write
+  // when immediate is +0xffff_ffff.
+  // For BPF_{B,H,W} the size of value stored matches size of the immediate.
----------------
Maybe add an extra explanation here such that.
For such cases, a LD_imm64 insn is generated to store +0xffff_ffff, followed by a 64-bit STX store.


================
Comment at: llvm/test/CodeGen/BPF/CORE/field-reloc-st-imm.ll:29
+
+; CHECK: [[L0:.Ltmp.*]]:
+; CHECK:       *(u8 *)(r1 + 0) = 1
----------------
Typically we put 'CHECK' inside the function or after the function. Could you put them after the 'bar' function?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140804



More information about the llvm-commits mailing list