This is an archive of the discontinued LLVM Phabricator instance.

[PatternMatch] Remove 64-bit or less restriction from m_SpecificInt
ClosedPublic

Authored by craig.topper on Jun 26 2017, 10:05 PM.

Details

Summary

Not sure why this restriction existed, but it seems like we should support any size Constant here.

The particular pattern in the tests is not the only use of this matcher in the tree. There's one in CodeGenPrepare and one in InstSimplify as well. I can try to add test cases for those if we want.

Diff Detail

Event Timeline

craig.topper created this revision.Jun 26 2017, 10:05 PM
davide edited edge metadata.Jun 26 2017, 10:55 PM

I don't have the tree handy here, but do you happen to know when this was introduced?

It looks like when m_SpecificInt was added in https://reviews.llvm.org/rL216586 in Aug 2014 it came with this restriction. I wonder if it was borrowed from the m_ConstantInt that writes to a uint64_t that's located right next to it in the file.

hfinkel accepted this revision.Jun 27 2017, 4:30 AM
hfinkel added a subscriber: hfinkel.

It looks like when m_SpecificInt was added in https://reviews.llvm.org/rL216586 in Aug 2014 it came with this restriction. I wonder if it was borrowed from the m_ConstantInt that writes to a uint64_t that's located right next to it in the file.

Seems likely.

LGTM.

This revision is now accepted and ready to land.Jun 27 2017, 4:30 AM
This revision was automatically updated to reflect the committed changes.