HomePhabricator

[SimplifyCFG] Fix invoke->call fold w/ multiple invokes in presence of lifetime…

Authored by lebedev.ri on Aug 8 2020, 7:57 AM.

Description

[SimplifyCFG] Fix invoke->call fold w/ multiple invokes in presence of lifetime intrinsics

SimplifyCFG has two main folds for resumes - one when resume is directly
using the landingpad, and the other one where resume is using a PHI node.

While for the first case, we were already correctly ignoring all the
PHI nodes, and both the debug info intrinsics and lifetime intrinsics,
in the PHI-based-one, we weren't ignoring PHI's in the resume block,
and weren't ignoring lifetime intrinsics. That is clearly a bug.

On RawSpeed library, this results in +9.34% (+81) more invoke->call folds,
-0.19% (-39) landing pads, -0.24% (-81) invoke instructions
but +51 call instructions and -132 basic blocks.

Though, the run-time performance impact appears to be within the noise.

Details

Committed
lebedev.riAug 8 2020, 10:00 AM
Parents
rG1f452ac1d784: [NFC][SimplifyCFG] Rewrite isCleanupBlockEmpty() to be iterator_range-based
Branches
Unknown
Tags
Unknown