[PATCH] [IR] Introduce a dereferenceable_xor_null(N) attribute.

Sanjoy Das sanjoy at playingwithpointers.com
Mon Mar 30 11:13:08 PDT 2015


> Normally, being null does not convey any information about being dereferenceable, but with this attribute, do you intend to change that?

Ideally, I'd like to teach LLVM that if it can prove a path
dereferences a null pointer then that path is not viable.  In
practice, most of our dereferences will be guarded with a null check
anyway, so I don't think we'll get a lot of real optimization out of
exploiting that.  So I'm okay going with "null_or_dereferenceable"
with the implication that pointers marked "null_or_dereferenceable"
can be both null and dereferenceable.

Nick, are you okay with "null_or_dereferenceable"?

-- Sanjoy



More information about the llvm-commits mailing list