Skip to content

gh-143946: Add more debug info in optimize_uops#144262

Merged
Fidget-Spinner merged 1 commit intopython:mainfrom
cocolato:add_debug_info
Jan 29, 2026
Merged

gh-143946: Add more debug info in optimize_uops#144262
Fidget-Spinner merged 1 commit intopython:mainfrom
cocolato:add_debug_info

Conversation

@cocolato
Copy link
Contributor

@cocolato cocolato commented Jan 27, 2026

In #143957, we can dump the stack and locals details when set PYTHON_OPT_DEBUG > 4. But it only print the details before we optimize the uops, add the debug info after the optimization is useful.

We can get some debug info like this now:

  61 abs: _STORE_ATTR_SLOT (0, target=2, operand0=0x10, operand1=0)
    locals=[<Point slots[0] v131145 at 0x74b74d76d4e8>, <int val=0xcc8670 at 0x74b74d76d4b8>, <int val=0xcc8690 at 0x74b74d76d4c8>]
    stack=[<int val=0xcc8670 at 0x74b74d76d4b8>, <Point slots[0] v131145 at 0x74b74d76d4e8>]
  61 out: _STORE_ATTR_SLOT_NULL (0, target=2, operand0=0x10, operand1=0)
    locals=[<Point slots[1] v131145 at 0x74b74d76d4e8>, <int val=0xcc8670 at 0x74b74d76d4b8>, <int val=0xcc8690 at 0x74b74d76d4c8>]
    stack=[<Point slots[1] v131145 at 0x74b74d76d4e8>]
 stack_level 1
  62 abs: _POP_TOP (0, target=2, operand0=0, operand1=0)
    locals=[<Point slots[1] v131145 at 0x74b74d76d4e8>, <int val=0xcc8670 at 0x74b74d76d4b8>, <int val=0xcc8690 at 0x74b74d76d4c8>]
    stack=[<Point slots[1] v131145 at 0x74b74d76d4e8>]
  62 out: _POP_TOP_NOP (0, target=2, operand0=0, operand1=0)
    locals=[<Point slots[1] v131145 at 0x74b74d76d4e8>, <int val=0xcc8670 at 0x74b74d76d4b8>, <int val=0xcc8690 at 0x74b74d76d4c8>]
    stack=[]
 stack_level 0

@cocolato cocolato changed the title Add more debug info in optimize_uops gh-143946: Add more debug info in optimize_uops Jan 27, 2026
@aisk aisk added the skip news label Jan 27, 2026
@cocolato
Copy link
Contributor Author

@Fidget-Spinner Hi, could please review this PR? Thanks!

@Fidget-Spinner
Copy link
Member

I'm very sorry. This PR is on my review list but I've been too busy these past few days.

@cocolato
Copy link
Contributor Author

Thanks for your reply! I can wait until you're free, and I'll find and take care of some other issues in the meantime.

@Fidget-Spinner Fidget-Spinner merged commit 26996b5 into python:main Jan 29, 2026
67 checks passed
@Fidget-Spinner
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants