Skip to content

GDA: merged simplifyCall logic into main loop#348

Merged
yuri91 merged 1 commit intomasterfrom
llc-optimizations
Feb 17, 2026
Merged

GDA: merged simplifyCall logic into main loop#348
yuri91 merged 1 commit intomasterfrom
llc-optimizations

Conversation

@andmadri
Copy link
Copy Markdown

optimizeCall was being invoked inside simplifyCall only when the optimization level was -O0. In its current form, simplifyCall iterates over all functions and instructions to call optimizeCall, and then performs another full iteration shortly after. This results in traversing the same instructions twice.

I merged the optimizeCall logic into the existing loop to eliminate the redundant traversal, ensuring it is executed before handling any other intrinsic so behavior remains unchanged.

I validated the change by running the test suite, particularly test/unit/codegen, and confirmed all tests pass with -O0. I also compared the generated binary sizes before and after the change and observed no differences. Additional manual tests using functions such as abs, pow, sqrt, and puts also behaved as expected.

I noticed that we would only optimize a call inside simplifyCall
if the optimization flag was set to -O0. Inside this function, we
would go through every instruction in every function, and call
optimizeCall for it. We are already looping through all functions and instructions
a couple of lines below it. It made sense to merge the logic and not
loop through every instruction twice as long as the optimizeCall was called before handling
any other intrinsic.
@yuri91 yuri91 added the hydra Run hydra on this PR label Feb 17, 2026
@yuri91 yuri91 merged commit 7fdda2d into master Feb 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hydra Run hydra on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants