[PATCH] D158503: [CGP] Remove dead PHI nodes before elimination of mostly empty blocks

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 22 03:44:59 PDT 2023


skatkov created this revision.
skatkov added reviewers: tmatheson, lenary, efriedma, aemerson, kparzysz, qiucf, t.p.northover, Carrot, JDevlieghere, thejh, apilipenko, anna.
Herald added subscribers: pengfei, arphaman, hiraditya, nemanjai, qcolombet.
Herald added a project: All.
skatkov requested review of this revision.
Herald added a project: LLVM.

Before elimination of mostly empty block it makes sense to remove dead PHI nodes.
It open more opportunity for elimination plus eliminates dead code itself.

It appeared that change results in failing many unit tests and some of them I've updated
and for another one I disable this optimization.
The pattern I observed in the tests is that there is a infinite loop without side effects.
As a result after elimination of dead phi node all other related instruction are also removed and
tests stops to check what it is expected.
I guess it is due to test is obtained by bugpoint.

I've added people related to these tests to check whether they are ok with update of the tests.


https://reviews.llvm.org/D158503

Files:
  llvm/lib/CodeGen/CodeGenPrepare.cpp
  llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-lse2.ll
  llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-rcpc.ll
  llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-rcpc3.ll
  llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-v8a.ll
  llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-lse2.ll
  llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-rcpc.ll
  llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-rcpc3.ll
  llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-v8a.ll
  llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-switch-bittest.ll
  llvm/test/CodeGen/AArch64/machine_cse.ll
  llvm/test/CodeGen/Hexagon/autohvx/lower-insert-elt.ll
  llvm/test/CodeGen/Hexagon/postinc-offset.ll
  llvm/test/CodeGen/Hexagon/swp-carried-1.ll
  llvm/test/CodeGen/Hexagon/swp-epilog-phi12.ll
  llvm/test/CodeGen/Hexagon/swp-epilog-phi6.ll
  llvm/test/CodeGen/Hexagon/swp-epilog-phi9.ll
  llvm/test/CodeGen/Hexagon/swp-lots-deps.ll
  llvm/test/CodeGen/Hexagon/swp-prolog-phi.ll
  llvm/test/CodeGen/Hexagon/swp-tfri.ll
  llvm/test/CodeGen/Hexagon/v6-unaligned-spill.ll
  llvm/test/CodeGen/PowerPC/sink-side-effect.ll
  llvm/test/CodeGen/PowerPC/sms-iterator.ll
  llvm/test/CodeGen/Thumb2/2011-06-07-TwoAddrEarlyClobber.ll
  llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll
  llvm/test/CodeGen/X86/2008-04-28-CoalescerBug.ll
  llvm/test/CodeGen/X86/avx512-i1test.ll
  llvm/test/CodeGen/X86/ins_subreg_coalesce-3.ll
  llvm/test/CodeGen/X86/masked_store.ll
  llvm/test/CodeGen/X86/pr49451.ll
  llvm/test/CodeGen/X86/pr53990-incorrect-machine-sink.ll
  llvm/test/CodeGen/X86/tail-dup-merge-loop-headers.ll
  llvm/test/CodeGen/X86/tail-opts.ll
  llvm/test/CodeGen/X86/x86-shrink-wrapping.ll
  llvm/test/Other/codegenprepare-and-debug.ll
  llvm/test/Transforms/CodeGenPrepare/X86/computedgoto.ll
  llvm/test/Transforms/CodeGenPrepare/X86/delete-assume-dead-code.ll
  llvm/test/Transforms/CodeGenPrepare/X86/sink-addrmode-base.ll
  llvm/test/Transforms/CodeGenPrepare/X86/sink-addrmode-two-phi.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158503.552299.patch
Type: text/x-patch
Size: 246674 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230822/ca259ae7/attachment-0001.bin>


More information about the llvm-commits mailing list