summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.h
diff options
context:
space:
mode:
authorVedant Paranjape <vedant.paranjape@amd.com>2023-05-09 11:56:48 +0000
committerVedant Paranjape <vedant.paranjape@amd.com>2023-05-09 11:58:05 +0000
commit438e1cff7bfba1693db9fe66e848efe85232c992 (patch)
treea25ce588ba1756eba6c1c6a14f74668d7c13eb00 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.h
parent5f3343985b20e0ae27368a1d3fd15896c4ed4fa5 (diff)
[PartialInlining] Fix incorrect costing when IR has unreachable BBs
Partial Inlining identifies basic blocks that can be outlined into a function. It is possible that an unreachable basic block is marked for outlining. During costing of the outlined region, such unreachable basic blocks are included as well. However, the CodeExtractor eliminates such unreachable basic blocks and emits outlined function without them. Thus, during costing of the outlined function, it is possible that the cost of the outlined function comes out to be lesser than the cost of outlined region, which triggers an assert. Assertion `OutlinedFunctionCost >= Cloner.OutlinedRegionCost && "Outlined function cost should be no less than the outlined region"' failed. This patch adds code to eliminate unreachable blocks from the function body before passing it on to be inlined. It also adds a test that checks for behaviour of costing in case of unreachable basic blocks. Discussion: https://discourse.llvm.org/t/incorrect-costing-in-partialinliner-if-ir-has-unreachable-basic-blocks/70163 Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D149130
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.h')
0 files changed, 0 insertions, 0 deletions