This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SVE] Fold away SETCC if original input was predicate vector.
ClosedPublic

Authored by sdesmalen on Feb 9 2022, 6:36 AM.

Details

Summary

This adds the following two folds:

Fold 1:

 setcc_merge_zero(
     all_active, extend(nxvNi1 ...), != splat(0))
-> nxvNi1 ...

Fold 2:

 setcc_merge_zero(
     pred, extend(nxvNi1 ...), != splat(0))
-> nxvNi1 and(pred, ...)

Diff Detail

Event Timeline

sdesmalen created this revision.Feb 9 2022, 6:36 AM
sdesmalen requested review of this revision.Feb 9 2022, 6:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 9 2022, 6:36 AM
sdesmalen edited the summary of this revision. (Show Details)Feb 9 2022, 6:37 AM
david-arm added inline comments.Feb 10 2022, 3:01 AM
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
17178

nit: Hi @sdesmalen, this is only a minor issue, but the notation in the comments is a little inconsistent in places. I found this a little confusing at first. For example, in some places it's

setcc_merge_zero(pred, LHS, RHS != 0)

and in others it's

setcc_merge_zero(CC, pred, ...)

Is it worth just sticking to a single notation for clarity?

17194

Is it worth adding a comment here explaining briefly why it's after legalisation?

sdesmalen updated this revision to Diff 410549.Feb 22 2022, 8:37 AM

Addressed @david-arm's comments.

david-arm accepted this revision.Feb 28 2022, 1:40 AM

LGTM! Thanks for making the changes @sdesmalen. :)

This revision is now accepted and ready to land.Feb 28 2022, 1:40 AM
This revision was landed with ongoing or failed builds.Feb 28 2022, 6:14 AM
This revision was automatically updated to reflect the committed changes.