[PATCH] D116854: bpf: Report an error properly for unsupported opcodes in lowering operations

Yonghong Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 8 11:10:20 PST 2022


yonghong-song added a comment.

> Without this patch, it leads to process crashes when unsupported gcc builtins are used, for example.

This is not correct description. The "llvm_unreachable" is intentional to catch all unsupported isd opcodes. If we find one unsupported isd opcode, we can add one case similar to ISD::DYNAMIC_STACKALLOC.
Please do have enough details in the commit messages so people can reproduce the issue if possible.



================
Comment at: llvm/lib/Target/BPF/BPFISelLowering.cpp:293
   default:
-    llvm_unreachable("unimplemented operand");
+    report_fatal_error("Unimplemented lowering operation opcode %u", Opcode);
   }
----------------
This is not correct. Did you actually test it? What is the actual printout?
The report_fatal_error() signature is report_fatal_error(llvm::StringRef/char[]/..., bool) and the second parameter is certainly not correct.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116854



More information about the llvm-commits mailing list