Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove vector sections (shared) utility #368

Open
MichaelSt98 opened this issue Aug 30, 2024 · 0 comments
Open

Remove vector sections (shared) utility #368

MichaelSt98 opened this issue Aug 30, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@MichaelSt98
Copy link
Collaborator

section_mapper = {s: s.body for s in FindNodes(ir.Section).visit(routine.body) if s.label == 'vector_section'}
if section_mapper:
    routine.body = Transformer(section_mapper).visit(routine.body)

However, quoting @reuterbal

a custom in-place transformer be more efficient here, that hooks into visit_tuple to inline Section bodies? That would save the
double traversal+rebuild.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant