Skip to content

Merge return should rewrite a single return in a loop. #2038

@s-perron

Description

@s-perron

The main purpose of merge return is to rewrite functions so that inlining is able to inline the function correctly. In #2018, we had to add another restriction: do not inline if there is a return in a loop, even if it is the only return.

This is because you cannot branch from that location directly to where it needs to go. We should get merge-return to work around this issue.

The example can be found here: https://github.com/KhronosGroup/SPIRV-Tools/files/2529819/spirvopt-bug.zip.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions