This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Add matchers for specific constants and a matcher for negations
ClosedPublic

Authored by paquette on Nov 12 2020, 6:02 PM.

Details

Summary

It's fairly common to need matchers for a specific constant value, or for common idioms like finding a negated register.

Add

  • m_SpecificICst, which returns true when matching a specific value..
  • m_ZeroInt, which returns true when an integer 0 is matched.
  • m_Neg, which returns when a register is negated.

Also simplify the code in a few places which could use the new matchers.

Diff Detail