[all-commits] [llvm/llvm-project] d7a056: [AMDGPU] Move LowerSwitch pass to CodeGenPrepare.

cdevadas via All-commits all-commits at lists.llvm.org
Sat Jul 11 04:22:28 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d7a05698efcfa6c596bcaadd8d5154612990f8f3
      https://github.com/llvm/llvm-project/commit/d7a05698efcfa6c596bcaadd8d5154612990f8f3
  Author: Christudasan Devadasan <Christudasan.Devadasan at amd.com>
  Date:   2020-07-11 (Sat, 11 Jul 2020)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
    A llvm/test/CodeGen/AMDGPU/switch-default-block-unreachable.ll

  Log Message:
  -----------
  [AMDGPU] Move LowerSwitch pass to CodeGenPrepare.

It is possible that LowerSwitch pass leaves certain blocks
unreachable from the entry. If not removed, these dead blocks
can cause undefined behavior in the subsequent passes.
It caused a crash in the AMDGPU backend after the instruction
selection when a PHI node has its incoming values coming from
these unreachable blocks.

In the AMDGPU pass flow, the last invocation of UnreachableBlockElim
precedes where LowerSwitch is currently placed and eventually
missed out on the opportunity to get these blocks eliminated.
This patch ensures that LowerSwitch pass get inserted earlier
to make use of the existing unreachable block elimination pass.

Reviewed By: sameerds, arsenm

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




More information about the All-commits mailing list