Convert more uops to leave their inputs on the stack to be cleaned up by `_POP_TOP`
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Python
- Estrelas
- 77.2k
- Forks
- 35.9k
- Métricas de merge de PRs
- Métricas de PR pendentes
Descrição
Feature or enhancement
Proposal:
This is a follow up to https://github.com/python/cpython/issues/134584
We have, in the JIT, optimizations to eliminate many _POP_TOP operations. To take advantage of that we have converted many uops to leave their operands on the stack and added subsequent _POP_TOPs to remove them.
See https://github.com/python/cpython/issues/134584 for many examples of how to do this and why it works.
However, there are still a few uops yet to do. These are:
- LIST_EXTEND
- DICT_UPDATE @Sacul0457
- SET_UPDATE @Sacul0457
- DICT_MERGE @NekoAsakura
- CALL_INTRINSIC_1 @Sacul0457
- CALL_INTRINSIC_2 @KevinH15291
In addition, POP_ITER, END_FOR and END_SEND can be implemented as macro ops, using POP_TOP to gain the benefit of the the POP_TOP optimization.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Linked PRs
- gh-145964
- gh-145979
- gh-146170
- gh-146177
- gh-146185
- gh-146190
- gh-146262
- gh-146329
- gh-146383
- gh-148227
- gh-148477
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece lendo a issue de acompanhamento 134584 para conhecer o padrão de conversão descrito e analise as uops restantes listadas: LIST_EXTEND, DICT_UPDATE, SET_UPDATE, DICT_MERGE, CALL_INTRINSIC_1 e CALL_INTRINSIC_2. Examine também como POP_ITER, END_FOR e END_SEND são representadas; considera-se concluído quando essas operações usam a abordagem proposta de limpeza da stack, mas os PRs vinculados mostram que esse trabalho já está em andamento.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- compilers, performance
- Tipo de issue
- Funcionalidade
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 25/100