This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Allow tail predication on sadd_sat and uadd_sat intrinsics
ClosedPublic

Authored by samtebbs on Jun 23 2020, 6:41 AM.

Details

Summary

This patch stops the sadd_sat and uadd_sat intrinsics from blocking tail predication.

Diff Detail

Event Timeline

samtebbs created this revision.Jun 23 2020, 6:41 AM
SjoerdMeijer added inline comments.Jun 23 2020, 7:03 AM
llvm/lib/Target/ARM/MVETailPredication.cpp
356

Do we expect more intrinsics to be allowed after these 2? For example, if we allow sadd, can we allow ssub too? And then while we are add it, add the ssubs too?
If we expect more intrinsics here, probably better to create an "AllowList" for intrinsics somewhere, and do a look-up here?

dmgreen added inline comments.Jun 23 2020, 7:28 AM
llvm/lib/Target/ARM/MVETailPredication.cpp
356

Can you give this a clang-format? The line is a bit long.

We might end up with quite a few of these too. It might make sense to add a switch on Int->getIntrinsicID() once this gets large enough.

llvm/test/CodeGen/Thumb2/LowOverheadLoops/tail-pred-intrinsic-uadd.ll
3

You can remove dso_local and local_unnamed_addr.

I would also make the two tests one file to keep them together, but up to you if you want to keep them separate.

xbolva00 added inline comments.
llvm/lib/Target/ARM/MVETailPredication.cpp
356

+1 for switch

samtebbs marked 3 inline comments as done.Jun 23 2020, 8:39 AM
samtebbs added inline comments.
llvm/lib/Target/ARM/MVETailPredication.cpp
356

I could replace this with a switch statement as suggested. What do you think?

356

Agreed. A switch would be much better.

llvm/test/CodeGen/Thumb2/LowOverheadLoops/tail-pred-intrinsic-uadd.ll
3

I'll remove ds_local and local_unnamed and merge them +1

samtebbs updated this revision to Diff 272948.Jun 24 2020, 2:45 AM

Change to switch statement and merge tests

samtebbs updated this revision to Diff 272949.Jun 24 2020, 2:50 AM

Remove dso_local and local_unnamed from test

dmgreen accepted this revision.Jun 24 2020, 7:35 AM

Thanks. LGTM

This revision is now accepted and ready to land.Jun 24 2020, 7:35 AM