[all-commits] [llvm/llvm-project] a701b7: [CGP] Remove dead PHI nodes before elimination of ...

serguei-katkov via All-commits all-commits at lists.llvm.org
Mon Aug 28 21:49:28 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a701b7e368b70688bb4b84dafcaa43fa7c9a3649
      https://github.com/llvm/llvm-project/commit/a701b7e368b70688bb4b84dafcaa43fa7c9a3649
  Author: Serguei Katkov <serguei.katkov at azul.com>
  Date:   2023-08-29 (Tue, 29 Aug 2023)

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

  Log Message:
  -----------
  [CGP] Remove dead PHI nodes before elimination of mostly empty blocks

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.

Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D158503




More information about the All-commits mailing list