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

gh-87092: reduce redundancy and repetition in compiler's optimization stage #96713

Merged
merged 10 commits into from
Sep 13, 2022

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Sep 9, 2022

  • replace calls to eliminate_empty_basic_blocks by an assertion that there are no empty blocks
  • same for a couple of inlined copies of the eliminate_empty_basic_blocks logic
  • rename clean_basic_block --> remove_redundant_nops for clarity
  • rename normalize_basic_block --> check_cfg and reduce it to only check (not remove empty blocks).
  • rename extend_block --> inline_small_exit_blocks. Make it inline blocks with linenos too (as it used to until bde06e1).
  • use the IS_UNCONDITIONAL_JUMP_OPCODE macro in a couple of places instead of checking precise opcodes

@iritkatriel iritkatriel added skip news interpreter-core (Objects, Python, Grammar, and Parser dirs) 3.12 bugs and security fixes labels Sep 9, 2022
@iritkatriel iritkatriel self-assigned this Sep 9, 2022
Python/compile.c Outdated Show resolved Hide resolved
@iritkatriel iritkatriel added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 9, 2022
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit 42a7525 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 9, 2022
@iritkatriel iritkatriel added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 9, 2022
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit d06fd46 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 9, 2022
@iritkatriel
Copy link
Member Author

@markshannon buildbots all pass with this. Any further comments?

Python/compile.c Outdated Show resolved Hide resolved
@iritkatriel iritkatriel added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 12, 2022
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit cf6d362 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 12, 2022
Copy link
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

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

A couple of questions

Python/compile.c Outdated Show resolved Hide resolved
Python/compile.c Show resolved Hide resolved
@markshannon markshannon self-requested a review September 13, 2022 10:38
@iritkatriel iritkatriel merged commit 6d7a0e0 into python:main Sep 13, 2022
@iritkatriel iritkatriel deleted the compiler_assertions branch September 29, 2022 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants