MachineFunction: Copy call site info when duplicating insts
authorVedant Kumar <vsk@apple.com>
Tue, 7 Apr 2020 20:09:29 +0000 (13:09 -0700)
committerVedant Kumar <vsk@apple.com>
Wed, 8 Apr 2020 18:06:14 +0000 (11:06 -0700)
commit48e65fc63076eec4fa527ab7b22fdcb4d8cdbb50
tree43ba44e4ca1bdd32d2a1ff13df1bcf607894ba73
parentbe3f8a8e1b95db1a8bdcc7a66ba27f8a6ea65469
MachineFunction: Copy call site info when duplicating insts

Summary:
Preserve call site info for duplicated instructions. We copy over the
call site info in CloneMachineInstrBundle to avoid repeated calls to
copyCallSiteInfo in CloneMachineInstr.

(Alternatively, we could copy call site info higher up the stack, e.g.
into TargetInstrInfo::duplicate, or even into individual backend passes.
However, I don't see how that would be safer or more general than the
current approach.)

Reviewers: aprantl, djtodoro, dstenb

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77685
llvm/lib/CodeGen/MachineFunction.cpp
llvm/test/CodeGen/X86/taildup-callsiteinfo.mir [new file with mode: 0644]
llvm/unittests/CodeGen/MFCommon.inc
llvm/unittests/CodeGen/MachineInstrTest.cpp