[PATCH] D142115: [ValueTracking] Take poison-generating metadata into account (PR59888)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 09:06:15 PST 2023


nikic added inline comments.


================
Comment at: llvm/lib/IR/Instruction.cpp:217
+         hasMetadata(LLVMContext::MD_nonnull) ||
+         hasMetadata(LLVMContext::MD_align);
+}
----------------
nlopes wrote:
> not sure about align.
> If a pointer is not sufficiently aligned, a load may crash. Returning poison in that case is not strong enough for the hardware behavior.
This is the same semantics we use for the param attribute. I think it's okay because any kind of speculation requires dereferenceable and align, and dereferenceable implies noundef.

(Note that this is the align metadata that specifies the alignment of the returned pointer, not the alignment of the load itself.)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142115/new/

https://reviews.llvm.org/D142115



More information about the llvm-commits mailing list