[all-commits] [llvm/llvm-project] 48634b: [NFC][PowerPC] Add NFC fixes to PPCInstrinfo.cpp w...

Amy Kwan via All-commits all-commits at lists.llvm.org
Tue Dec 6 12:24:26 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 48634b3b935fd0bb325c08fce6313fadcdcb6f86
      https://github.com/llvm/llvm-project/commit/48634b3b935fd0bb325c08fce6313fadcdcb6f86
  Author: Amy Kwan <amy.kwan1 at ibm.com>
  Date:   2022-12-06 (Tue, 06 Dec 2022)

  Changed paths:
    M llvm/lib/Target/PowerPC/PPCInstrInfo.cpp

  Log Message:
  -----------
  [NFC][PowerPC] Add NFC fixes to PPCInstrinfo.cpp when getting the defined machine instruction.

This patch adds the following NFC fixes to PPCInstrInfo.cpp when getting the DefMI:
- Fix documentation error to state that we want to flag a use of register
  between the def and the MI (in post-RA)
- Setting the DefMI to null if the DefMI is neither an LI or and ADDI
  (while still being in SSA form).

In terms of setting the DefMI to null, this change aims to account for the
scenario of when we end up going through all operands on the machine instruction
MI and updating OpNoForForwarding accordingly once an ADDI is found as the DefMI.

It is possible that once an ADDI is found, we will continue to go through all
operands in attempts to find an LI, but end up looking at every operand until
we reach the end if we have not yet found an LI. In the case where the end is
reached and we never end up finding an LI/ADDI, DefMI would be pointing to the
last operand of MI while OpNoForForwarding would still be pointing at the
previous ADDI operand found. We reset DefMI to avoid having DefMI point to an
instruction that differs from the one represented by OpNoForForwarding.

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




More information about the All-commits mailing list