[all-commits] [llvm/llvm-project] d79275: [MachineSink] replace MachineLoop with MachineCycle

Chen Zheng via All-commits all-commits at lists.llvm.org
Thu May 26 03:45:39 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d79275238f9fb11fac31d42a846fe80fca2306d9
      https://github.com/llvm/llvm-project/commit/d79275238f9fb11fac31d42a846fe80fca2306d9
  Author: Chen Zheng <czhengsz at cn.ibm.com>
  Date:   2022-05-26 (Thu, 26 May 2022)

  Changed paths:
    M llvm/include/llvm/ADT/GenericCycleImpl.h
    M llvm/include/llvm/ADT/GenericCycleInfo.h
    M llvm/include/llvm/CodeGen/MachineCycleAnalysis.h
    M llvm/include/llvm/CodeGen/MachinePassRegistry.def
    M llvm/include/llvm/CodeGen/MachineSSAContext.h
    M llvm/lib/CodeGen/MachineCycleAnalysis.cpp
    M llvm/lib/CodeGen/MachineSink.cpp
    M llvm/test/CodeGen/AArch64/O3-pipeline.ll
    M llvm/test/CodeGen/AArch64/loop-sink-limit.mir
    M llvm/test/CodeGen/AMDGPU/llc-pipeline.ll
    M llvm/test/CodeGen/ARM/O3-pipeline.ll
    M llvm/test/CodeGen/PowerPC/O3-pipeline.ll
    M llvm/test/CodeGen/RISCV/O3-pipeline.ll
    M llvm/test/CodeGen/X86/opt-pipeline.ll
    M llvm/test/CodeGen/X86/pr38795.ll
    M llvm/test/CodeGen/X86/switch-phi-const.ll
    M llvm/test/CodeGen/X86/x86-shrink-wrapping.ll

  Log Message:
  -----------
  [MachineSink] replace MachineLoop with MachineCycle

reapply 62a9b36fcf728b104ea87e6eb84c0be69b779df7 and fix module build
failue:
1: remove MachineCycleInfoWrapperPass in MachinePassRegistry.def
   MachineCycleInfoWrapperPass is a anylysis pass, should not be there.
2: move the definition for MachineCycleInfoPrinterPass to cpp file.

Otherwise, there are module conflicit for MachineCycleInfoWrapperPass
in MachinePassRegistry.def and MachineCycleAnalysis.h after
62a9b36fcf728b104ea87e6eb84c0be69b779df7.

MachineCycle can handle irreducible loop. Natural loop
analysis (MachineLoop) can not return correct loop depth if
the loop is irreducible loop. And MachineSink is sensitive
to the loop depth, see MachineSinking::isProfitableToSinkTo().

This patch tries to use MachineCycle so that we can handle
irreducible loop better.

Reviewed By: sameerds, MatzeB

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




More information about the All-commits mailing list