[PATCH] Fix GlobalOpt to use range metadata instead of creating SelectInsts.

Dan Gohman dan433584 at gmail.com
Fri Mar 7 11:16:57 PST 2014


On Fri, Feb 28, 2014 at 11:38 AM, Dan Gohman <dan433584 at gmail.com> wrote:

> Hello,
> Previously, when GlobalOpt noticed that a GlobalVariable only ever has two
> values, it replaced the GlobalVariable with a boolean, and introduced
> SelectInsts to produce the desired values. The main purpose of this was to
> expose the value range information to subsequent optimization passes.
> espindola on IRC suggested that range metadata could achieve the same
> purpose. Attached is a patch which replaces GlobalOpt's
> TryToShrinkGlobalToBoolean with a TryToAddRangeMetadata. The metadata is
> sufficient to enable the main optimization that TryToShrinkGlobalToBoolean
> enabled, as can be seen in the test/Transforms/GlobalOpt/integer-bool.ll
> test.
> Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140307/bd5c96fd/attachment.html>

More information about the llvm-commits mailing list