[all-commits] [llvm/llvm-project] 0776c4: Recommit "[LICM] Only create load in ph when promo...

Florian Hahn via All-commits all-commits at lists.llvm.org
Sun May 29 14:00:37 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0776c48f9b7e69fa447bee57c7c0985caa856be9
      https://github.com/llvm/llvm-project/commit/0776c48f9b7e69fa447bee57c7c0985caa856be9
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2022-05-29 (Sun, 29 May 2022)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LICM.cpp
    M llvm/test/Transforms/LICM/scalar-promote.ll

  Log Message:
  -----------
  Recommit "[LICM] Only create load in ph when promoting load or store doesn't exec."

This reverts the revert commit ad95255b9215a.

The updated version also creates a load when the store may not execute.
In those cases, we still need to introduce a load in a function where
there may not have been one before, so this doesn't completely resolve
issue #51248.

Original message:

    When only a store is sunk, there is no need to create a load in the
    pre-header, as the result of the load will never get used.

    The dead load can can introduce UB, if the function is marked as
    writeonly.

    Reviewed By: nikic

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




More information about the All-commits mailing list