[all-commits] [llvm/llvm-project] 02e3d5: Fix DSE miscompile when store is clobbered across ...

arpilipe via All-commits all-commits at lists.llvm.org
Thu Feb 27 14:43:08 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 02e3d5c3a25b9c00c0ab9bdd59931fde606ee0b4
      https://github.com/llvm/llvm-project/commit/02e3d5c3a25b9c00c0ab9bdd59931fde606ee0b4
  Author: Artur Pilipenko <apilipenko at azulsystems.com>
  Date:   2020-02-27 (Thu, 27 Feb 2020)

  Changed paths:
    M llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
    M llvm/test/Transforms/DeadStoreElimination/simple.ll

  Log Message:
  -----------
  Fix DSE miscompile when store is clobbered across loop iterations

DSE would mistakenly remove store (2):

  a = calloc(n+1)
  for (int i = 0; i < n; i++) {
    store 1, a[i+1] // (1)
    store 0, a[i]   // (2)
  }

The fix is to do PHI transaltion while looking for clobbering
instructions between the store and the calloc.

Reviewed By: efriedma, bjope

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




More information about the All-commits mailing list