[PATCH] D133103: [PowerPC] Improve kill flag computation and add verification after MI peephole

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 04:39:10 PDT 2022


nemanjai created this revision.
nemanjai added reviewers: PowerPC, qiongsiwu.
Herald added subscribers: shchenz, kbarton, hiraditya.
Herald added a project: All.
nemanjai requested review of this revision.
Herald added a project: LLVM.

The MI Peephole pass has grown to include a large number of transformations over the years. Many of the transformations require re-computation of kill flags but don't do a good job of re-computing them. This causes us to have very common failures when the compiler is built with expensive checks. Over time, we added and augmented a function that is supposed to go and fix up kill flags after each transformation but we keep missing cases.
This patch does the following:

- Removes the function to re-compute kill flags
- Adds LiveVariables to compute and maintain kill flags while transforming code
- Adds re-computation of kill flags for the post-RA peepholes for each block that contains a transformed instruction
- Improves some of the LLVM_DEBUG messages and adds missing ones
- Does a bit of general clean-up in the pass


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133103

Files:
  llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
  llvm/lib/Target/PowerPC/PPCInstrInfo.h
  llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
  llvm/lib/Target/PowerPC/PPCPreEmitPeephole.cpp
  llvm/test/CodeGen/PowerPC/O3-pipeline.ll
  llvm/test/CodeGen/PowerPC/convert-ri-addi-to-ri.mir
  llvm/test/CodeGen/PowerPC/convert-rr-to-ri-instrs-kill-flag.mir
  llvm/test/CodeGen/PowerPC/convert-rr-to-ri-instrs-out-of-range.mir
  llvm/test/CodeGen/PowerPC/convert-rr-to-ri-instrs.mir
  llvm/test/CodeGen/PowerPC/fixup-kill-dead-flag-crash.mir
  llvm/test/CodeGen/PowerPC/fold-rlwinm.mir
  llvm/test/CodeGen/PowerPC/jump-tables-collapse-rotate-remove-SrcMI.mir
  llvm/test/CodeGen/PowerPC/mi-peephole.mir
  llvm/test/CodeGen/PowerPC/peephole-miscompile-extswsli.mir
  llvm/test/CodeGen/PowerPC/peephole-phi-acc.mir
  llvm/test/CodeGen/PowerPC/remove-redundant-li-implicit-reg.mir
  llvm/test/CodeGen/PowerPC/rlwinm_rldicl_to_andi.mir
  llvm/test/CodeGen/PowerPC/unreachable-mbb-jtreference-elimination.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133103.457229.patch
Type: text/x-patch
Size: 68792 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220901/2a107e4d/attachment-0001.bin>


More information about the llvm-commits mailing list