[all-commits] [llvm/llvm-project] e4251f: [LangRef][Local] dereferenceable metadata violatio...

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Apr 14 01:56:31 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e4251fc6bb0d4fc0bc35f3ad7fd846beeb4a7b07
      https://github.com/llvm/llvm-project/commit/e4251fc6bb0d4fc0bc35f3ad7fd846beeb4a7b07
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-04-14 (Fri, 14 Apr 2023)

  Changed paths:
    M llvm/docs/LangRef.rst
    M llvm/lib/Transforms/Utils/Local.cpp
    M llvm/test/Transforms/GVN/metadata.ll

  Log Message:
  -----------
  [LangRef][Local] dereferenceable metadata violation is UB

I believe !dereferencable violation is immediate undefined behavior,
but this was not explicitly spelled out in LangRef. We already
assume that !dereferenceable is implicitly !noundef and cannot
return poison in isGuaranteedNotToBeUndefOrPoison().

The reason why we made dereferenceable implicitly noundef is that
the purpose of this metadata is to allow speculation, and that
would not be legal on a potential poison pointer.

Differential Revision: https://reviews.llvm.org/D148202




More information about the All-commits mailing list