This is an archive of the discontinued LLVM Phabricator instance.

[SveEmitter] Add IsAppendSVALL and builtins for svptrue and svcnt[bhwd]
ClosedPublic

Authored by sdesmalen on Apr 6 2020, 3:14 PM.

Details

Summary

Some ACLE builtins leave out the argument to specify the predicate
pattern, which is expected to be expanded to an SV_ALL pattern.

This patch adds the flag IsAppendSVALL to append SV_ALL as the final
operand.

Diff Detail

Event Timeline

sdesmalen created this revision.Apr 6 2020, 3:14 PM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: tschuett. · View Herald Transcript
efriedma added inline comments.Apr 15 2020, 2:58 PM
clang/lib/CodeGen/CGBuiltin.cpp
7913

The Ops.size() <= 1 seems to return the same result for all the intrinsics you're implementing now. Does it become relevant later?

sdesmalen marked an inline comment as done.Apr 16 2020, 1:37 PM
sdesmalen added inline comments.
clang/lib/CodeGen/CGBuiltin.cpp
7913

Yes that's right, this is there for the saturating inc/dec intrinsics, e.g.

There is the one that takes a predicate pattern:

int32_t svqdecb_pat[_n_s32](int32_t op, svpattern pattern, uint64_t imm_factor)

and one where the pattern SV_ALL is implicit (and inserted as the second operand):

int32_t svqdecb[_n_s32](int32_t op, uint64_t imm_factor)
efriedma added inline comments.Apr 16 2020, 3:27 PM
clang/lib/CodeGen/CGBuiltin.cpp
7913

I think it would be more clear to use a separate flag for that, so it's obvious what codepaths in EmitAArch64SVEBuiltinExpr actually correspond to particular intrinsics.

sdesmalen updated this revision to Diff 258416.Apr 17 2020, 1:44 PM
sdesmalen retitled this revision from [SveEmitter] Add ExpandOp1SVALL and builtin for svptrue to [SveEmitter] Add IsAppendSVALL and builtins for svptrue and svcnt[bhwd].
sdesmalen edited the summary of this revision. (Show Details)
  • Renamed flag to IsAppendSVALL to distinguish it from the case of IsInsertOp1SVALL that will follow in a separate patch.
sdesmalen updated this revision to Diff 259555.Apr 23 2020, 6:57 AM
sdesmalen marked 2 inline comments as done.
  • Added comment explaining need for expanding SV_ALL

Gentle ping :)

This revision is now accepted and ready to land.Apr 24 2020, 12:11 PM
This revision was automatically updated to reflect the committed changes.