[PATCH] D64500: [DebugInfo] Remove call sites when eliminating unreachable blocks

Nikola Prica via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 11 04:07:48 PDT 2019


NikolaPrica added a comment.

@dstenb The patch looks good! LGTM! Thanks for working on this!

> Wdyt of addressing this problem in a more general way, e.g. in MachineInstruction::eraseFromParent itself?
>  edit: I meant to write MachineBasicBlock::eraseFromParent, but I think the point still stands.

That would be great and we would not need to worry about validity of the `CallSitesInfo`. But the thing is that we have a problem with the `MI` range deletion from the `MBB` (see for example `MachineOutliner::outline` or version before this feature for `TargetInstrInfo::ReplaceTailWithBranchTo`). Such deletions cannot be generalized. For now, there are just two of such cases but in further we may stumble across more.
The whole idea behind this assertion and update is to evade generalization in the destructor of the `MachineInst` (which is the safest but requires certain overhead) and to use the update only when necessary. Similarly will be with the `eraseFromParent`, it will require certain overhead.
Please let us know if you have an idea how to overcome those constraints.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64500/new/

https://reviews.llvm.org/D64500





More information about the llvm-commits mailing list