[all-commits] [llvm/llvm-project] a3db9c: [PowerPC] Remove redundant CRSET/CRUNSET in custom...

Yi-Hong Lyu via All-commits all-commits at lists.llvm.org
Fri Nov 8 07:33:05 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a3db9c08ebdf1f39ed89f4a7afa09fc153cf98c5
      https://github.com/llvm/llvm-project/commit/a3db9c08ebdf1f39ed89f4a7afa09fc153cf98c5
  Author: Yi-Hong Lyu <Yi-Hong.Lyu at ibm.com>
  Date:   2019-11-08 (Fri, 08 Nov 2019)

  Changed paths:
    M llvm/lib/Target/PowerPC/PPCInstrInfo.td
    M llvm/lib/Target/PowerPC/PPCPreEmitPeephole.cpp
    M llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
    M llvm/test/CodeGen/PowerPC/knowCRBitSpill.ll

  Log Message:
  -----------
  [PowerPC] Remove redundant CRSET/CRUNSET in custom lowering of known CR bit spills

We lower known CR bit spills (CRSET/CRUNSET) to load and spill the known value
but forgot to remove the redundant spills.

e.g., This sequence was used to spill a CRUNSET:
    crclr   4*cr5+lt
    mfocrf  r3,4
    rlwinm  r3,r3,20,0,0
    stw     r3,132(r1)

Custom lowering of known CR bit spills lower it to:
    crxor 4*cr5+lt, 4*cr5+lt, 4*cr5+lt
    li  r3,0
    stw r3,132(r1)

crxor is redundant if there is no use of 4*cr5+lt so we should remove it

Differential revision: https://reviews.llvm.org/D67722




More information about the All-commits mailing list