This is an archive of the discontinued LLVM Phabricator instance.

[IR] (NFC) [BasicBlock] updatePHIEdges, duplicatePHIEdges and fixPHIEdges
Needs ReviewPublic

Authored by Marandil on Jun 16 2017, 10:24 AM.

Details

Summary

[IR] Add three public functions to BasicBlock to handle bulk changes to PHINodes caused by changing control flow graph.
updatePHIEdges changes all usages of one BB into another BB.
duplicatePHIEdges duplicates all incoming edges from one BB into incoming edges from another BB.
fixPHIEdges checks if a given BB is still a valid predecessor and based on this uses either of update or duplicate.

This diff is a follow up after https://reviews.llvm.org/D33787. I am submitting a new diff and closing the old one, since the inline comments in the latter would be unintelligible after the API changes.

Diff Detail

Event Timeline

Marandil created this revision.Jun 16 2017, 10:24 AM