HomePhabricator

[SimplifyCFG] Use a (trivially) dominanting widenable branch to remove later…

Authored by reames on Nov 4 2019, 9:40 AM.

Description

[SimplifyCFG] Use a (trivially) dominanting widenable branch to remove later slow path blocks

This transformation is a variation on the GuardWidening transformation we have checked in as it's own pass. Instead of focusing on merge (i.e. hoisting and simplifying) two widenable branches, this transform makes the observation that simply removing a second slowpath block (by reusing an existing one) is often a very useful canonicalization. This may lead to later merging, or may not. This is a useful generalization when the intermediate block has loads whose dereferenceability is hard to establish.

As noted in the patch, this can be generalized further, and will be.

Differential Revision: https://reviews.llvm.org/D69689