[PATCH] D146277: add assert to confirm input is valid for pass HardwareLoops

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 03:33:52 PDT 2023


fhahn added inline comments.


================
Comment at: llvm/lib/CodeGen/HardwareLoops.cpp:330
 
+  assert(
+      Opts.Bitwidth.has_value() && Opts.Decrement.has_value() &&
----------------
It shouldn't be possible to trigger an assert when passing arguments to the pass. If there's an invalid combination, it should be handled gracefully, e.g. bailing out without doing anything (together with a debug message perhaps) or using a sane default value if it makes sense.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146277



More information about the llvm-commits mailing list