This is an archive of the discontinued LLVM Phabricator instance.

[IR][Patternmatch] Add m_SpecificInt_ULT() predicate
ClosedPublic

Authored by lebedev.ri on Jun 26 2019, 2:51 AM.

Details

Summary

Match an integer or vector with every element unsigned less than the
Threshold. For vectors, this includes constants with undefined elements.

Diff Detail

Repository
rL LLVM

Event Timeline

spatel accepted this revision.Jun 27 2019, 7:40 AM

LGTM - not sure if it's worth generalizing or a TODO comment, but we could take a predicate as a parameter (rather than hard-coding 'ULT') and switch the APInt compare method based on that?

This revision is now accepted and ready to land.Jun 27 2019, 7:40 AM

LGTM

Thank you for the review.

not sure if it's worth generalizing or a TODO comment, but we could take a predicate as a parameter (rather than hard-coding 'ULT') and switch the APInt compare method based on that?

Do yo propose passing ICmpInst::Predicate?
I did briefly think about it, and wasn't sure it's worth it *yet*.

LGTM

Thank you for the review.

not sure if it's worth generalizing or a TODO comment, but we could take a predicate as a parameter (rather than hard-coding 'ULT') and switch the APInt compare method based on that?

Do yo propose passing ICmpInst::Predicate?
I did briefly think about it, and wasn't sure it's worth it *yet*.

Yes, that's what I imagined. And yes, I have no idea if it's worth it, so a TODO comment or a mention in the commit message is enough for now.

This revision was automatically updated to reflect the committed changes.