[NFC] Factor out utilities for manipulating widenable branches
authorPhilip Reames <listmail@philipreames.com>
Tue, 19 Nov 2019 22:43:13 +0000 (14:43 -0800)
committerPhilip Reames <listmail@philipreames.com>
Tue, 19 Nov 2019 22:43:13 +0000 (14:43 -0800)
commit70c68a6b0e515967dba5b30f6a60e220a8cd8d2c
tree23ec3ddaefb2ed5edc15e23376ecfb5d284ddd8a
parentf3eb5dee5756876be0524c59c21478659eba8c4d
[NFC] Factor out utilities for manipulating widenable branches

With the widenable condition construct, we have the ability to reason about branches which can be 'widened' (i.e. made to fail more often).  We've got a couple o transforms which leverage this.  This patch just cleans up the API a bit.

This is prep work for generalizing our definition of a widenable branch slightly.  At the moment "br i1 (and A, wc()), ..." is considered widenable, but oddly, neither "br i1 (and wc(), B), ..." or "br i1 wc(), ..." is.  That clearly needs addressed, so first, let's centralize the code in one place.
llvm/include/llvm/Analysis/GuardUtils.h
llvm/include/llvm/Transforms/Utils/GuardUtils.h
llvm/lib/Analysis/GuardUtils.cpp
llvm/lib/Transforms/Scalar/GuardWidening.cpp
llvm/lib/Transforms/Scalar/LoopPredication.cpp
llvm/lib/Transforms/Utils/GuardUtils.cpp