[MachineOutliner] NFC: Add debug output to MachineOutliner::outline
Add some debug output to `outline` to assist in debugging + understanding the code. This will say - How many things we found worth turning into outlined functions - Whether or not candidates were pruned via the outlining algorithm - The function created (if it was created) - Where the calls were inserted - What instruction was used to create the call Sample output below: ``` NUMBER OF POTENTIAL FUNCTIONS: 5 WALKING FUNCTION LIST PRUNED: 0/2 candidates OUTLINE: Expected benefit (12 B) > threshold (1 B) NEW FUNCTION: OUTLINED_FUNCTION_0 CREATE OUTLINED CALLS CALL: OUTLINED_FUNCTION_0 in bar:<unknown> .. BL @OUTLINED_FUNCTION_0, implicit-def $lr, implicit $sp CALL: OUTLINED_FUNCTION_0 in bar:<unknown> .. BL @OUTLINED_FUNCTION_0, implicit-def $lr, implicit $sp PRUNED: 2/2 candidates SKIP: Expected benefit (0 B) < threshold (1 B) PRUNED: 0/2 candidates OUTLINE: Expected benefit (8 B) > threshold (1 B) NEW FUNCTION: OUTLINED_FUNCTION_1 CREATE OUTLINED CALLS CALL: OUTLINED_FUNCTION_1 in bar:<unknown> .. BL @OUTLINED_FUNCTION_1, implicit-def $lr, implicit $sp CALL: OUTLINED_FUNCTION_1 in bar:<unknown> .. BL @OUTLINED_FUNCTION_1, implicit-def $lr, implicit $sp PRUNED: 2/2 candidates SKIP: Expected benefit (0 B) < threshold (1 B) PRUNED: 2/2 candidates SKIP: Expected benefit (0 B) < threshold (1 B) ```
Loading
Please sign in to comment