[PATCH] D116817: [IRBuilder] Simplify 'or 0, RHS' -> RHS on creation.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 7 10:10:06 PST 2022


fhahn added a comment.

In D116817#3227871 <https://reviews.llvm.org/D116817#3227871>, @nikic wrote:

> IRBuilder accepts a Folder that currently gives you the choice between no folding, target-independent constant folding and target-dependent constant folding. If we change the API to not be restricted to Constants, we could add a SimplifyFolder that calls into InstSimplify instead.
>
> Maybe that would help more generally for what you're currently doing? We could generate code in the straightforward way, but let IRBuilder fold away trivial identities via simplification, without having to reimplement them.

I think it might make sense to provide a InstSimplifyFolder in general, but it looks like this will require some larger changes, as at the moment all folders only seem to support constants.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116817/new/

https://reviews.llvm.org/D116817



More information about the llvm-commits mailing list