[TargetLowering][NFC] More efficient emitPatchpoint().
authorDenis Antrushin <dantrushin@gmail.com>
Thu, 4 Jun 2020 16:11:13 +0000 (19:11 +0300)
committerDenis Antrushin <dantrushin@gmail.com>
Fri, 5 Jun 2020 11:57:29 +0000 (14:57 +0300)
commit66a1b83bf93ec46f6d7a06c47d5981ae154f9ea0
treefd2f25ffeccf4b2c104f58f3ba95d81026f9b936
parentc6aa829644f30d5590451b892918298f8117c985
[TargetLowering][NFC] More efficient emitPatchpoint().

Current implementation of emitPatchpoint() is very inefficient:
for every FrameIndex operand if creates new MachineInstr with
that operand expanded and all other copied as is.
Since PATCHPOINT/STATEPOINT instructions may have *a lot* of
FrameIndex operands, we end up creating and erasing many
machine instructions. But we can do it in single pass, with only
one new machine instruction generated.

Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D81181
llvm/lib/CodeGen/TargetLoweringBase.cpp