[PATCH] D149651: [UnreachableBlockElim] Don't remove LCSSA phi nodes

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 2 07:33:55 PDT 2023


foad created this revision.
foad added reviewers: AMDGPU, resistor, nhaehnle, Petar.Avramovic, sameerds.
Herald added subscribers: kosarev, StephenFan, kerbowa, hiraditya, tpr, jvesely, MatzeB.
Herald added a project: All.
foad requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Revert svn r54432:

  SDISel's constant branch folding can fold away self-loops, which doesn't result in any dead blocks, but
  rather an incorrect phi input.  Add code to UnreachableMachineBlockElim to get rid of these entries.

The effect of the reversion is not to remove single-input phi nodes as
created by LCSSA. Instead, phi nodes are only removed if they started
with multiple inputs but were reduced to a single input because some of
their predecessor blocks were unreachable.

This makes a significant difference on AMDGPU where we deliberately go
into LCSSA form before instruction selection. I have not noticed any
effect on other targets.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149651

Files:
  llvm/lib/CodeGen/UnreachableBlockElim.cpp
  llvm/test/CodeGen/AMDGPU/vgpr-liverange-ir.ll
  llvm/test/CodeGen/AMDGPU/wave32.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149651.518724.patch
Type: text/x-patch
Size: 15251 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230502/09c89261/attachment.bin>


More information about the llvm-commits mailing list