[llvm-commits] [llvm] r117048 - /llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp

Dan Gohman gohman at apple.com
Thu Oct 21 12:01:23 PDT 2010


Author: djg
Date: Thu Oct 21 14:01:22 2010
New Revision: 117048

URL: http://llvm.org/viewvc/llvm-project?rev=117048&view=rev
Log:
Update comments.

Modified:
    llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp

Modified: llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp?rev=117048&r1=117047&r2=117048&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp Thu Oct 21 14:01:22 2010
@@ -21,9 +21,29 @@
 // This is a work-in-progress. It doesn't work yet, and the metadata
 // format isn't stable.
 //
-// TODO: getModRefBehavior. The AliasAnalysis infrastructure will need to
-//       be extended.
-// TODO: struct fields
+// The current metadata format is very simple. MDNodes have up to three
+// fields, e.g.:
+//   !0 = metadata !{ !"name", !1, 0 }
+// The first field is an identity field. It can be any MDString which
+// uniquely identifies the type. The second field identifies the type's
+// parent node in the tree, or is null or omitted for a root node.
+// If the third field is present, it's an integer which if equal to 1
+// indicates that the type is "constant".
+//
+// TODO: The current metadata encoding scheme doesn't support struct
+// fields. For example:
+//   struct X {
+//     double d;
+//     int i;
+//   };
+//   void foo(struct X *x, struct X *y, double *p) {
+//     *x = *y;
+//     *p = 0.0;
+//   }
+// Struct X has a double member, so the store to *x can alias the store to *p.
+// Currently it's not possible to precisely describe all the things struct X
+// aliases, so struct assignments must use conservative TBAA nodes. There's
+// no scheme for attaching metadata to @llvm.memcpy yet either.
 //
 //===----------------------------------------------------------------------===//
 





More information about the llvm-commits mailing list