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

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Apr 17 05:15:31 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6f7e5c0f1ac6cc3349a2e1479ac4208465b272c6
      https://github.com/llvm/llvm-project/commit/6f7e5c0f1ac6cc3349a2e1479ac4208465b272c6
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-04-17 (Mon, 17 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 a miscompile in GVN, which was fixed by D148129.

-----

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