This is an archive of the discontinued LLVM Phabricator instance.

[m_Constant] Check #operands/results before hasTrait()
ClosedPublic

Authored by lattner on Mar 14 2021, 6:41 PM.

Details

Summary

We know that all ConstantLike operations have one result and no operands,
so check this first before doing the trait check. This change speeds up
Canonicalize on a CIRCT testcase by ~5%.

Diff Detail

Event Timeline

lattner created this revision.Mar 14 2021, 6:41 PM
lattner requested review of this revision.Mar 14 2021, 6:41 PM
rriddle accepted this revision.Mar 14 2021, 6:54 PM
This revision is now accepted and ready to land.Mar 14 2021, 6:54 PM
This revision was landed with ongoing or failed builds.Mar 14 2021, 8:14 PM
This revision was automatically updated to reflect the committed changes.

thank you for the review!