morganstanley / hobbes

A language and an embedded JIT compiler
http://hobbes.readthedocs.io/
Apache License 2.0
1.16k stars 105 forks source link

stop hobbes from generating large IR functions #442

Closed mo-xiaoming closed 1 year ago

mo-xiaoming commented 1 year ago

For certain match input, hobbes might generate really large IR functions and it takes forever for llvm to parse

  1. be conservative with "inlining" when translating DFA to IR if current DFA might have too many states
  2. stop FunctionInliningPass() if there is one function in this module is already too large

There is a flag buildColumnwiseMatch() designed for preventing large DFA generation. However, the code path introduced by this flag has never been properly tested, and it has upper row count limit which is not that hard to exceed