[PATCH] Constant fold llvm.expect(c, ...) -> c

Chandler Carruth chandlerc at google.com
Mon Jan 26 10:24:20 PST 2015


On Sun, Jan 25, 2015 at 9:37 PM, Pete Cooper <peter_cooper at apple.com> wrote:

> Hi hfinkel,
>
> This teaches the constant folder that an llvm.expect intrinsic with a
> constant as the first operand will return that constant.
>
> This reduces the size of an LTO'd llc by over 1% due to branches which can
> be removed once the constant is propagated.
>

I really don't understand this.

The design llvm.expect was specifically for LowerExpect to remove *all* of
these intrinsics from the IR? Why isn't that working?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150126/e2673a9b/attachment.html>


More information about the llvm-commits mailing list