[PATCH] D13428: Add verification for align, dereferenceable, dereferenceable_or_null load metadata

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 8 09:58:02 PDT 2015


reames added a subscriber: reames.
reames accepted this revision.
reames added a reviewer: reames.
reames added a comment.
This revision is now accepted and ready to land.

LGTM w/minor comments addressed.


================
Comment at: lib/IR/Verifier.cpp:3081
@@ +3080,3 @@
+  ConstantInt *CI = mdconst::dyn_extract<ConstantInt>(MD->getOperand(0));
+  Assert(CI, "dereferenceable, dereferenceable_or_null metadata "
+         "value must be an integer!", &I);
----------------
I might combine these last two checks into a single one, but minor.  

================
Comment at: lib/IR/Verifier.cpp:3243
@@ +3242,3 @@
+           "align metadata value must be a power of 2!", &I);
+    Assert(Align <= Value::MaximumAlignment, "alignment is too big", &I);
+  }
----------------
This message could be clearer.  "Alignment is larger that implementation defined limit" maybe?


http://reviews.llvm.org/D13428





More information about the llvm-commits mailing list