[all-commits] [llvm/llvm-project] 53500e: Reapply [SimplifyCFG][LICM] Preserve nonnull, rang...

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Apr 20 05:17:37 PDT 2023


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

  Changed paths:
    M llvm/include/llvm/IR/Instruction.h
    M llvm/lib/IR/Instruction.cpp
    M llvm/lib/Transforms/Scalar/LICM.cpp
    M llvm/lib/Transforms/Scalar/SROA.cpp
    M llvm/lib/Transforms/Utils/Local.cpp
    M llvm/lib/Transforms/Utils/SimplifyCFG.cpp
    M llvm/test/Transforms/LICM/hoist-metadata.ll
    M llvm/test/Transforms/SimplifyCFG/hoist-with-metadata.ll

  Log Message:
  -----------
  Reapply [SimplifyCFG][LICM] Preserve nonnull, range and align metadata when speculating

This exposed another miscompile in GVN, which was fixed by
20e9b31f88149a1d5ef78c0be50051e345098e41.

-----

After D141386, violation of nonnull, range and align metadata
results in poison rather than immediate undefined behavior,
which means that these are now safe to retain when speculating.
We only need to remove UB-implying metadata like noundef.

This is done by adding a dropUBImplyingAttrsAndMetadata() helper,
which lists the metadata which is known safe to retain on speculation.

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




More information about the All-commits mailing list