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

Drop poison implying metadata #65216

Closed
wants to merge 2 commits into from

Conversation

DianQK
Copy link
Member

@DianQK DianQK commented Sep 3, 2023

Fixes #65195.

Hoisting a poison is safe only when it doesn't introduce more UB.

Currently, I'm just preventing preserving metadata like range.
I'm going to backport to LLVM.
17, so I don't want to introduce too many changes.

I think there are two approaches to restoring this range:
a. Do a may analysis using dataflow. However, in the issue, we have to consider both the result of the instruction and the operation value propagation. This can make the analysis complicated or useless.
b. Introduces a new valid scope for the metadata record range. This way we can reasonably determine whether UB can be triggered.

I'm not sure which is better. But I tend to favor method B. From what I understand, we use UB for optimization. I think a poison that can't trigger a UB makes no sense.

…ttrsAndMetadata`.

Hoisting a poison is safe only when it doesn't introduce more UB.
@DianQK DianQK requested review from a team as code owners September 3, 2023 00:51
@DianQK DianQK requested review from nikic and luxufan September 3, 2023 00:51
Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

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

This is not the correct fix, as multiple people have already explained to you on the issue.

@DianQK DianQK closed this Sep 3, 2023
@DianQK DianQK deleted the drop-poison-implying-metadata branch September 4, 2023 00:02
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.

JumpThreading error removes call void @bar() instruction.
2 participants