Index: lib/IR/Verifier.cpp =================================================================== --- lib/IR/Verifier.cpp +++ lib/IR/Verifier.cpp @@ -3195,12 +3195,16 @@ visitRangeMetadata(I, Range, I.getType()); } - if (I.getMetadata(LLVMContext::MD_nonnull)) { - Assert(I.getType()->isPointerTy(), "nonnull applies only to pointer types", + if (I.getMetadata(LLVMContext::MD_nonnull) || + I.getMetadata(LLVMContext::MD_dereferenceable || + I.getMetadata(LLVMContext::MD_dereferenceable_or_null) || + I.getMetadata(LLVMContext::MD_align) { + Assert(I.getType()->isPointerTy(), "nonnull, align, derefernceable, " + "derefernceable_or_null metadata apply only to pointer types", &I); Assert(isa(I), - "nonnull applies only to load instructions, use attributes" - " for calls or invokes", + "nonnull, align, derefernceable, derefernceable_or_null apply " + "only to load instructions, use attributes for calls or invokes", &I); }