[llvm] [LangRef] Clarify `align` and `nonnull` interaction with `noundef` in parameter attributes section (PR #224236)
Ömer Sinan Ağacan via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 18 00:54:54 PDT 2026
osa1 wrote:
@dtcxzyw it doesn't clarify what "the behavior" is.
I think even dropping the whole part with `noundef` would make this more clear than it is (then sentence starting the "The align attribute should be combined with ..."). Otherwise the "the behavior is undefined" part should clarify what "the behavior" exactly is as it's entirely unclear to me that "the behavior" could possible be referring to. (I now know the answer know, but it took a good hour of hacking, investigating, and chatting to figure it out)
An experienced dev could think of all the possibilities of what "the behavior" here could be referring to and figure it out, but for a new dev you often can't possibly enumerate all the possibilities of what it could be referring to and figure it out yourself.
It would be helpful to get reviews from other new devs here.
---
I just checked the `noundef` documentation and it has the same issue...
> This attribute applies to parameters and return values. If the value representation contains any undefined or poison bits, the behavior is undefined. Note that this does not refer to padding introduced by the type’s storage representation.
The mysterious "the behavior" again...
We're documenting an attribute, there's no "behavior" here.. If it was an intrinsic or instruction, it'd be obvious. For a parameter attribute, the behaviour can refer to:
- A caller passing an argument for the parameter
- The callee using the parameter
- Something else that I can't think of.
"The behavior" doesn't say which.
https://github.com/llvm/llvm-project/pull/224236
More information about the llvm-commits
mailing list