Skip to content

[CodeGen] Emit a call instruction instead of an invoke if the called llvm function is marked nounwind #1478

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

Merged
merged 1 commit into from
Jul 18, 2020

Conversation

ahatanaka
Copy link

This fixes cases where an invoke is emitted, despite the called llvm
function being marked nounwind, because ConstructAttributeList failed to
add the attribute to the attribute list. llvm optimization passes turn
invokes into calls and optimize away the exception handling code, but
it's better to avoid emitting the code in the front-end if the called
function is known not to raise an exception.

Differential Revision: https://reviews.llvm.org/D83906

(cherry picked from commit ed6b578)

llvm function is marked nounwind

This fixes cases where an invoke is emitted, despite the called llvm
function being marked nounwind, because ConstructAttributeList failed to
add the attribute to the attribute list. llvm optimization passes turn
invokes into calls and optimize away the exception handling code, but
it's better to avoid emitting the code in the front-end if the called
function is known not to raise an exception.

Differential Revision: https://reviews.llvm.org/D83906

(cherry picked from commit ed6b578)
@ahatanaka
Copy link
Author

@swift-ci test macOS

2 similar comments
@ahatanaka
Copy link
Author

@swift-ci test macOS

@ahatanaka
Copy link
Author

@swift-ci test macOS

@ahatanaka ahatanaka merged commit 7b4d65e into apple/stable/20200714 Jul 18, 2020
@ahatanaka ahatanaka deleted the emitcall branch July 18, 2020 04:25
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.

1 participant