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

Add support for inbounds, nsw, nuw, exact flags #568

Open
Benjins opened this issue Feb 7, 2025 · 0 comments
Open

Add support for inbounds, nsw, nuw, exact flags #568

Benjins opened this issue Feb 7, 2025 · 0 comments

Comments

@Benjins
Copy link

Benjins commented Feb 7, 2025

Is your feature request related to a problem? Please describe.
The instruction-specific flags (e.g. inbounds, nsw, nuw, exact) do not seem to be exposed (I could not find any docs on them, and I don't see the relevant llvm-sys API calls in the code). Specifically, add/sub/mul instructions can have nuw/nsw flags, udiv/sdiv/urem/srem instructions can have the exact flag, and getelementptr instructions can have the inbounds flag. These should all now be exposed via llvm-sys, though some only in more recent LLVM versions

Describe the solution you'd like
This information should be exposed somehow. I see that the fast-math flags, disjoint, volatile, etc. are exposed on the InstructionValue struct. That seems like a logical place to expose these as well, unless there's another place that is considered more appropriate or there are concerns about InstructionValue taking on too much surface

Additional context
LangRef - Binary arithmetic ops
LangRef - GEP

There are likely other flags coming down the pipeline: the samesign flag for icmp instructions, for example

If it's as simple as adding getter/setter methods to InstructionValue, I can take a crack at a PR. Figured it was worth opening an issue to see if there were other thoughts

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

No branches or pull requests

1 participant