This is a patch to add nonnull and align to assume's operand bundle
only if noundef exists.
Since nonnull and align in fn attr have poison semantics, they should be
paired with noundef or noundef-implying attributes to be immediate UB.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Transforms/Utils/AssumeBundleBuilder.cpp | ||
---|---|---|
203 | The new code isn't super clean compared to the previous one, but I had to pivot to iterate-per-argidx first to check existence of noundef in the callsite and called function. :( |
I think the process of checking is a value is noundef needs to be more general than just calls. maybe addKnowledge would be a better place.
because nonnull and align information can also be inferred from loads/stores.
Hi, sorry for my delay in response.
Could you elaborate a bit with an example, please?
Does it mean that the updated analysis may return suboptimal results?
llvm/lib/Transforms/Utils/AssumeBundleBuilder.cpp | ||
---|---|---|
201 | I think this interface must take a Use not a value. Then you can check if Attr is allowed to be transformed into an operand bundle by checking if the use has noundef as well. |
llvm/lib/Transforms/Utils/AssumeBundleBuilder.cpp | ||
---|---|---|
201 | Checking if the use (parameter) has noundef seemed great idea to me, it could shorten the code quite a bit. |
after further thinking, moving nonundef checking to addKnowledge is not needed since if align or nonnnull was wrong the load/store would have UB.
the code is much shorter and much more readable now.
LGTM.
clang-format not found in user's PATH; not linting file.