This is an archive of the discontinued LLVM Phabricator instance.

This patch adds a predicateinfo intrinsic, as part of splitting up D29316.
ClosedPublic

Authored by dberlin on Feb 3 2017, 2:34 PM.

Details

Summary

The intrinsic, marked as returning it's first argument, has no code
generation effect (though currently not every optimization pass knows
that intrinsics with the returned attribute can be looked through).

It is used to attach predicate information to existing operands, and
be able to tell what the predicate information affects.

We deliberately do not attach any info through a second operand so
that the intrinsics do not need to dominate the comparisons/etc (since
in the case of assume, we may want to push them up the post-dominator
tree).

Diff Detail

Repository
rL LLVM

Event Timeline

dberlin created this revision.Feb 3 2017, 2:34 PM
dberlin updated this revision to Diff 87037.Feb 3 2017, 3:02 PM
  • Add PredicateInfo utility, and printing pass.

Sigh, one sec, it screwed this up

dberlin updated this revision to Diff 87039.Feb 3 2017, 3:04 PM

Fixing update

sanjoy added inline comments.Feb 3 2017, 8:48 PM
docs/LangRef.rst
12689 ↗(On Diff #87039)

How about calling this llvm.ssa_copy or something like that, given how general this is?

12702 ↗(On Diff #87039)

"attached" is kind of vague -- can you be more specific here?

dberlin added inline comments.Feb 3 2017, 9:06 PM
docs/LangRef.rst
12689 ↗(On Diff #87039)

I kind of deliberately gave it a name that made it so people wouldn't try to use it as a generic copy intrinsic, because i'm not sure we want that used elsewhere :)

But if we do, ...

12702 ↗(On Diff #87039)

Sure, would "the first argument is an operand which the PredicateInfo utility creates information about. Transforms/Utils/PredicateInfo.h has more information, but a brief overview is below".

work?

IE how specific do you want it?

  • Update for review comments
dberlin marked 2 inline comments as done.Feb 5 2017, 11:28 AM
dberlin marked 2 inline comments as done.
davide accepted this revision.Feb 6 2017, 7:00 PM

The intrinsic description (and the intrinsic itself, LGTM). I'm reviewing predicate info next.

This revision is now accepted and ready to land.Feb 6 2017, 7:00 PM
This revision was automatically updated to reflect the committed changes.