[all-commits] [llvm/llvm-project] f192a2: Sink: Handle instruction sink when a user is dead

Changpeng Fang via All-commits all-commits at lists.llvm.org
Fri Oct 9 16:21:18 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f192a27ed3bacdf727f27857adeb6d3762383295
      https://github.com/llvm/llvm-project/commit/f192a27ed3bacdf727f27857adeb6d3762383295
  Author: Changpeng Fang <Changpeng.Fang at amd.com>
  Date:   2020-10-09 (Fri, 09 Oct 2020)

  Changed paths:
    M llvm/lib/Transforms/Scalar/Sink.cpp
    A llvm/test/Transforms/Sink/dead-user.ll

  Log Message:
  -----------
  Sink: Handle instruction sink when a user is dead

Summary:
  The current instruction sink pass uses findNearestCommonDominator of all users to find block to sink the instruction to.
However, a user may be in a dead block, which will result in unexpected behavior.

This patch handles such cases by skipping dead blocks. This patch fixes:
https://bugs.llvm.org/show_bug.cgi?id=47415

Reviewers:
  MaskRay, arsenm

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




More information about the All-commits mailing list