[PATCH] D97092: [ValueTracking] Handle assumes on arguments with context instruction

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 22 09:26:59 PST 2021


reames added a comment.

One idea on an alternate approach we could explore...

In the langref, we have an alternate way of spelling assumes using operand bundles.  The key advantage of that approach (in the context of this discussion), is that there are no ephemeral icmps generated.  We still have to concern ourselves with not eliminating assumes, but at least the assumes are themselves direct uses of the values we're inferring facts about.

If we were to extend the operand bundle syntax to allow arbitrary predicates, we could allow the use of the operand bundle assumes without a context, and simply restrict transform passes from *directly* simplifying assume operands.  The only tricky case I see here is equalities as CSE would tend to replace the operands in the deopt bundle if e.g. instsimplify knew two values were equivalent from the assume.  (I haven't fully thought this through.)

If we do pursue this, we'd need to untangle the operand bundle form handling from the knowledge transfer work, but that doesn't seem challenging.  I'm not sure why those are coupled currently anyways.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97092



More information about the llvm-commits mailing list