diff options
author | Vedant Kumar <vsk@apple.com> | 2020-04-07 13:09:29 -0700 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2020-04-08 11:06:14 -0700 |
commit | 48e65fc63076eec4fa527ab7b22fdcb4d8cdbb50 (patch) | |
tree | 43ba44e4ca1bdd32d2a1ff13df1bcf607894ba73 /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | be3f8a8e1b95db1a8bdcc7a66ba27f8a6ea65469 (diff) | |
download | llvm-48e65fc63076eec4fa527ab7b22fdcb4d8cdbb50.zip llvm-48e65fc63076eec4fa527ab7b22fdcb4d8cdbb50.tar.gz llvm-48e65fc63076eec4fa527ab7b22fdcb4d8cdbb50.tar.bz2 |
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
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 271fc8c..1b89333 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -426,6 +426,11 @@ MachineInstr &MachineFunction::CloneMachineInstrBundle(MachineBasicBlock &MBB, break; ++I; } + // Copy over call site info to the cloned instruction if needed. If Orig is in + // a bundle, copyCallSiteInfo takes care of finding the call instruction in + // the bundle. + if (Orig.shouldUpdateCallSiteInfo()) + copyCallSiteInfo(&Orig, FirstClone); return *FirstClone; } |