summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorZhenkai Weng <theoaktree1040@gmail.com>2023-05-05 15:43:58 -0700
committerPeter Rong <PeterRong96@gmail.com>2023-05-09 13:58:10 -0700
commit39b6a7f06ea970db6b09932a4582376fba71f6b9 (patch)
tree25e81540e743090ef13925a73d0a9118c541a7cb /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
parentb77e41f2886aca278b41a85fc0f947e078b3da13 (diff)
[FuzzMutate] Module size heuristics
IRMutation::mutateModule() currently requires the bitcode size of the module. To compute the bitcode size, one way is to write the module to a buffer using BitcodeWriter and calculating the buffer size. This would be fine for a single mutation, but infeasible for repeated mutations due to the large overhead. It turns out that the only IR strategy weight calculation method that depends on the current module size is InstDeleterStrategy, which deletes instructions more frequently as the module size approaches a given max size. However, there is no real need for the size to be in bytes of bitcode, so we can use a different metric. One alternative is to let the size be the number of objects in the Module, including instructions, basic blocks, globals, and aliases. Although getting the number of instructions is still O(n), it should have significantly less overhead than BitcodeWriter. This suggestion would cause a change to the IRMutator API, since IRMutator::mutateModule() can calculate the Module size itself. Reviewed By: Peter Differential Revision: https://reviews.llvm.org/D149989
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
0 files changed, 0 insertions, 0 deletions