[PATCH] D156136: [BPF] Clean up SelLowering

Tamir Duberstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 08:48:29 PDT 2023


tamird created this revision.
tamird added reviewers: eddyz87, ast, yonghong-song.
Herald added a subscriber: hiraditya.
Herald added a project: All.
tamird requested review of this revision.
Herald added subscribers: llvm-commits, wangpc.
Herald added a project: LLVM.

This patch contains a number of uncontroversial changes:

- Replace all uses of `errs`, `assert`, `llvm_unreachable` with `report_fatal_error` with informative error strings.
- Rename `fail` to `unsupported` to clarify that the function emits a diagnostic, leaving the decision to fail in the hands of the embedder.
- Replace calls to `fail` (now `unsupported`) in loops with at most one call per error instance. Previously a function with 19 arguments would log "too many args" 14 times. This was not helpful.
- Always use braced if.
- Rename variables to appease clang-tidy.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156136

Files:
  llvm/lib/Target/BPF/BPFISelLowering.cpp
  llvm/lib/Target/BPF/BPFISelLowering.h
  llvm/test/CodeGen/BPF/many_args1.ll
  llvm/test/CodeGen/BPF/many_args2.ll
  llvm/test/CodeGen/BPF/struct_ret1.ll
  llvm/test/CodeGen/BPF/vararg1.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156136.543572.patch
Type: text/x-patch
Size: 25727 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230724/3cf50217/attachment.bin>


More information about the llvm-commits mailing list