[all-commits] [llvm/llvm-project] 78b1fb: [SimplifyCFG][LICM] Preserve nonnull, range and al...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Apr 4 01:04:02 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 78b1fbc63f78660ef10e3ccf0e527c667a563bc8
      https://github.com/llvm/llvm-project/commit/78b1fbc63f78660ef10e3ccf0e527c667a563bc8
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-04-04 (Tue, 04 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/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:
  -----------
  [SimplifyCFG][LICM] Preserve nonnull, range and align metadata when speculating

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