-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[WIP] Precise range metadata for enums with disjoint ranges #133836
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
Conversation
The job Click to see the possible cause of the failure (guessed by this bot)
|
bx.set_metadata(load, llvm::MD_range, md); | ||
} | ||
} | ||
} else if !scalar.is_always_valid(bx) { | ||
bx.range_metadata(load, scalar.valid_range(bx)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, if you're going to do this, I would expect it to be on the Layout somehow, like valid_range
is.
After all, if this is worth doing then it's probably worth doing for char
as well, and I wouldn't want to duplicate everything about ranges in multiple places.
(But check with the LLVM folks to see whether this is even useful in the first place, since I don't know if multiple range metadata are even used.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have never seen it being used anywhere, not even in this simplest example: https://alive2.llvm.org/ce/z/JEe2Q3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like not worth pursuing for now; thanks!
Fixes #133822
Very WIP
r? @ghost