[PATCH] D67722: [PowerPC] Remove redundant CRSET/CRUNSET in custom lowering of known CR bit spills

Yi-Hong Lyu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 18 10:49:12 PDT 2019


Yi-Hong.Lyu created this revision.
Yi-Hong.Lyu added reviewers: power-llvm-team, hfinkel, echristo, nemanjai, jsji.
Herald added subscribers: llvm-commits, shchenz, MaskRay, kbarton, hiraditya, qcolombet.
Herald added a project: LLVM.
Yi-Hong.Lyu edited the summary of this revision.
Herald added a subscriber: wuzish.
Yi-Hong.Lyu edited the summary of this revision.

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:

  crclr   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


https://reviews.llvm.org/D67722

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67722.220702.patch
Type: text/x-patch
Size: 4161 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190918/4a93ebc0/attachment.bin>


More information about the llvm-commits mailing list