This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] cttz(abs(x)) -> cttz(x)
ClosedPublic

Authored by xbolva00 on Jun 19 2019, 5:54 AM.

Details

Diff Detail

Repository
rL LLVM

Event Timeline

xbolva00 created this revision.Jun 19 2019, 5:54 AM
xbolva00 added a reviewer: spatel.

It is generally helpful to write some patch descriptions (you want those for git log anyway),
and provide alive proofs, since you likely had to come up with one when developing anyway.

xbolva00 added a comment.EditedJun 19 2019, 7:53 AM

It is generally helpful to write some patch descriptions (you want those for git log anyway),
and provide alive proofs, since you likely had to come up with one when developing anyway.

I would like to, but I think https://rise4fun.com/Alive does not support @llvm.cttz (intrinsics at all), or am I wrong?

Edit: please see https://reviews.llvm.org/D63534

xbolva00 edited the summary of this revision. (Show Details)Jun 19 2019, 11:07 AM
lebedev.ri added inline comments.Jun 20 2019, 10:44 AM
lib/Transforms/InstCombine/InstCombineCalls.cpp
1200 ↗(On Diff #205561)

I'm not sure why we're limiting to single-use?

1202 ↗(On Diff #205561)

So since for cttz the sub is transparent, we should be ok with SPF_NABS too?

xbolva00 updated this revision to Diff 205870.EditedJun 20 2019, 12:16 PM

Removed OneUse check.
Added vector tests.
Added support for NABS, added tests for NABS.

Thanks for review, @lebedev.ri

(Please precommit all the tests)

xbolva00 updated this revision to Diff 205878.Jun 20 2019, 12:29 PM

Precommited tests, rebased.

lebedev.ri accepted this revision.Jun 21 2019, 5:28 AM

Looks ok.

This revision is now accepted and ready to land.Jun 21 2019, 5:28 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2019, 8:24 AM