[PATCH] D26438: [Verifier] Add verification for TBAA metadata

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 9 11:34:23 PST 2016


sanjoy added a comment.

> I may have misunderstood your point, but for struct-path TBAA, the last integer for a type node is the offset. Only for old scalar TBAA, the last optional integer specifies whether it is immutable. There is no ambiguity in struct-path TBAA.

Thanks, that clears it up for me.

> This patch is for general goodness. Thanks for working on it. I wonder if it makes sense to share some logic between the verifier and TypeBasedAliasAnalysis.cpp, in terms of how to parse the various fields of the struct path tag nodes and the struct type nodes.

I didn't share too much since I want the verifier to be as self contained as is reasonable.  Moreover, I want utilities in TypeBasedAliasAnalysis.cpp to trip asserts when a node is malformed, whereas in the verifier I want them to fail gracefully.



================
Comment at: lib/IR/Verifier.cpp:409
   void visitBasicBlock(BasicBlock &BB);
   void visitRangeMetadata(Instruction& I, MDNode* Range, Type* Ty);
+  void visitDereferenceableMetadata(Instruction &I, MDNode *MD);
----------------
manmanren wrote:
> Can we also change the format here, like the below statement?
I'll check in a one line cleanup change now and rebase.


================
Comment at: lib/IR/Verifier.cpp:4050
+    visitTBAAMetadata(I, TBAA);
+  }
+
----------------
manmanren wrote:
> I wonder why we switched the order between TBAAMetadata and MD_dereferenceable_or_null.
It was unintentional -- I'll move it back.


https://reviews.llvm.org/D26438





More information about the llvm-commits mailing list