Verify that !noalias, !alias.scope and llvm.experimental.noalias.scope arguments have the format specified in https://llvm.org/docs/LangRef.html#noalias-and-alias-scope-metadata. I've fixed up a lot of broken metadata used by tests in advance. Especially using a scope instead of the expected scope list is a commonly made mistake.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
@Meinersbur I partially fixed the alias metadata generated by polly in https://github.com/llvm/llvm-project/commit/53720f74e4e32fe11a1688282f7d09dc1828b83a. However, another fix for the "second level" metadata is needed. This code is doing something very odd in https://github.com/llvm/llvm-project/blob/53720f74e4e32fe11a1688282f7d09dc1828b83a/polly/lib/CodeGen/IRBuilder.cpp#L207 where it apparently creates an alias scope with another alias scope used as a domain. It wasn't obvious to me what the right way to adjust this code is.
@nikic Thanks for fixing Polly. Regarding the "second level" metadata, it represents another source known non-aliasing from internal "Inter iteration alias-free" annotations which were added as part of a GSoC. I am going to have a look on what it is trying to achieve.
@nikic I ended up removing the second level metadata in https://github.com/llvm/llvm-project/commit/cad9f98a2ad98fecf663e9ce39502b8e43676fc9. Thanks again for fixing the fixing the array-based noalias metadata.
Seems like that this patch now contradicts the methods MDBuilder.h:createAnonymousAliasScopeDomain and createAnonymousAliasScope. If you actually give it a string, it won't verify. I wonder if you should amend this changing the methods as well?
These methods are intended to be supported and are used in-tree and do verify there. Could you provide an example that would fail? Please keep in mind that scoped alias metadata always deals in scope lists, while createAnonymousAliasScope() only creates an isolated scope. You cannot pass the result of createAnonymousAliasScope() directly to !noalias, !alias.scope, etc.
Yes. But MDB.createAnonymousAliasScopeDomain("mystring") noew creates e.g. the domain !33 = distinct !{!33, !"mystring"}, which leads to the verifier error "second scope operand must be MDNode". This seems inconsistent. Same happens for createAnonymousAliasScope().
I take it back. My confusion came from the fact that we were not creating lists as you pointed out above! Thanks for the tip, I think the methods are fine.
Did you run clang-format ?