[PATCH] D78010: [CodeGen] Add a new parameter SkipDuplicated for copyImplicitOps()

Zhang Kang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 13 03:12:22 PDT 2020


ZhangKang created this revision.
ZhangKang added reviewers: jsji, nemanjai, hfinkel, PowerPC, steven.zhang, dexonsmith, stoklund.
ZhangKang added a project: LLVM.
Herald added subscribers: wuzish, hiraditya.
ZhangKang added reviewers: lhames, ab, qikon.

The function `MachineInstr::copyImplicitOps(MachineFunction &MF, const MachineInstr &MI)` and `MachineInstrBuilder::copyImplicitOps(const MachineInstr &OtherMI)` will copy all implicit ops from Src_MI to Dst_MI.

When the Src_MI and Dst_MI has the same implicit ops, if we still call copyImplicitOps(), we will get some redundant implicit reg.

This patch is to add a new parameter SkipDuplicated for copyImplicitOps(), so we can choose whether we need skip those duplicated operands.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78010

Files:
  llvm/include/llvm/CodeGen/MachineInstr.h
  llvm/include/llvm/CodeGen/MachineInstrBuilder.h
  llvm/lib/CodeGen/MachineInstr.cpp
  llvm/lib/Target/PowerPC/PPCEarlyReturn.cpp
  llvm/test/CodeGen/PowerPC/early-ret-verify.mir
  llvm/test/CodeGen/PowerPC/early-ret.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78010.256947.patch
Type: text/x-patch
Size: 5910 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200413/0e36cad2/attachment.bin>


More information about the llvm-commits mailing list