[llvm] Remove llvm::shouldOptForSize() from Utils.h (PR #112630)

Kyungwoo Lee via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 13:28:44 PDT 2024


================
@@ -635,8 +636,12 @@ class GIMatchTableExecutor {
 
   bool shouldOptForSize(const MachineFunction *MF) const {
----------------
kyulee-com wrote:

It appears that ISel generally prioritizes optimization for size. Since the `shouldOptForSize` derives its result from the current processing block, the outcome may not be consistent depending on which blocks are being processed, which is counterintuitive.
Upon examining another usage of DAGISel below, I believe this API is actually asking whether the current function should be optimized for size based on the current processing block or DAG.
https://github.com/llvm/llvm-project/blob/66bbbf2e951a486f972a5a54378e6791193ade60/llvm/include/llvm/CodeGen/SelectionDAGISel.h#L396-L398

So, we should keep this way on this context.

https://github.com/llvm/llvm-project/pull/112630


More information about the llvm-commits mailing list