Skip to content

Enhance Flags mangling/demangling - #7506

Merged
sklam merged 1 commit into
numba:masterfrom
sklam:enh/flags_demangle
Nov 4, 2021
Merged

sklam merged 1 commit into
numba:masterfrom
sklam:enh/flags_demangle

Conversation

@sklam

@sklam sklam commented Oct 21, 2021 •

Copy link
Copy Markdown
Member

changes

demangle:

  • to deal with _ escaped string
  • to become a classmethod

mangling:

  • include more values into the zdict for shorter output

To manually demangle Numba symbol and extract the compilation flags:

  1. mangled symbol _ZN5numba7cpython7unicode11integer_str12_3clocals_3e9impl_2425B40c8tJTIeFCjyCbUFRqqOAK_2f6h0phxApbQBAA_3dEi (probably from debugger)
  2. use c++filt to demangle:
    % c++filt -n _ZN5numba7cpython7unicode11integer_str12_3clocals_3e9impl_2425B40c8tJTIeFCjyCbUFRqqOAK_2f6h0phxApbQBAA_3dEi
    numba::cpython::unicode::integer_str::_3clocals_3e::impl_2425[abi:c8tJTIeFCjyCbUFRqqOAK_2f6h0phxApbQBAA_3d](int)
  3. extract the part in [abi:...]
  4. put it through:
>>> from numba.core.compiler import Flags
>>> Flags.demangle("c8tJTIeFCjyCbUFRqqOAK_2f6h0phxApbQBAA_3d")
b'Flags(enable_looplift=True, enable_pyobject_looplift=True, no_cpython_wrapper=True)'

demangle:
- to deal with `_` escaped string
- to become a classmethod

mangling:
- include more values into the zdict for shorter output
@sklam
sklam marked this pull request as ready for review October 22, 2021 14:01
@sklam sklam added 3 - Ready for Review Effort - short Short size effort needed labels Oct 22, 2021
@sklam sklam added this to the Numba 0.55 RC milestone Oct 22, 2021

@stuartarchibald stuartarchibald left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch, looks good.

@stuartarchibald stuartarchibald added 5 - Ready to merge Review and testing done, is ready to merge and removed 3 - Ready for Review labels Nov 4, 2021
@sklam
sklam merged commit f41b7e3 into numba:master Nov 4, 2021
@sklam
sklam deleted the enh/flags_demangle branch November 4, 2021 21:32
stuartarchibald added a commit to stuartarchibald/numba that referenced this pull request Nov 5, 2021
sklam added a commit that referenced this pull request Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5 - Ready to merge Review and testing done, is ready to merge Effort - short Short size effort needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants