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

lgc: Optimally insert return block during cps lowering #2758

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

ruiling
Copy link
Contributor

@ruiling ruiling commented Oct 12, 2023

If the original function does not have return instruction, we don't need the runtime check to exit, thus no need to insert return block.

A handy command to fixup the test check:
sed -i 's/llvm.amdgcn.set.inactive.i32/llvm.amdgcn.set.inactive.{{(chain.arg.)?}}i32/g' lgc/test/Transforms/CpsLowering/*

If the original function does not have `return` instruction, we don't
need the runtime check to exit, thus no need to insert return block.

A handy command to fixup the test check:
sed -i 's/llvm.amdgcn.set.inactive.i32/llvm.amdgcn.set.inactive.{{(chain.arg.)?}}i32/g' lgc/test/Transforms/CpsLowering/*
@ruiling ruiling requested a review from a team as a code owner October 12, 2023 06:36
@amdvlk-admin
Copy link

Test summary for commit 7a995d4

CTS tests (Failed: 0/139021)
  • Built with version 1.3.5.2
  • Ubuntu navi3x, Srdcvk
    • Passed: 41144/69517 (59.2%)
    • Failed: 0/69517 (0.0%)
    • Not Supported: 28373/69517 (40.8%)
    • Warnings: 0/69517 (0.0%)
    Ubuntu navi2x, Srdcvk
    • Passed: 41177/69504 (59.2%)
    • Failed: 0/69504 (0.0%)
    • Not Supported: 28327/69504 (40.8%)
    • Warnings: 0/69504 (0.0%)

Copy link
Member

@nhaehnle nhaehnle left a comment

Choose a reason for hiding this comment

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

One nit, but LGTM otherwise.


builder.SetInsertPoint(chainBlock);
if (chainBlock)
builder.SetInsertPoint(chainBlock);
Copy link
Member

Choose a reason for hiding this comment

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

This could be moved in the îfabove, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it can, I just move this out of the above if for the sake of clear code (compiler should be able to simplify the branch here), this line should better stay with the code below not the above.

@ruiling ruiling merged commit 14e3138 into GPUOpen-Drivers:dev Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants