[PatternMatch] Add m_SExtOrSelf(), m_ZExtOrSExtOrSelf() matchers + unittests
authorRoman Lebedev <lebedev.ri@gmail.com>
Fri, 27 Sep 2019 21:53:04 +0000 (21:53 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Fri, 27 Sep 2019 21:53:04 +0000 (21:53 +0000)
commit8c39d016705e04be7dcfddae8997a36fcd0ee30d
tree23e90dfe83050aff6cf758a5a33a064209816680
parent0b1b3c6068dfacd267dded0395ef1fa262cb3f8c
[PatternMatch] Add m_SExtOrSelf(), m_ZExtOrSExtOrSelf() matchers + unittests

m_SExtOrSelf() is for consistency.

m_ZExtOrSExtOrSelf() is motivated by the D68103/r373106 :
sometimes it is useful to look past any extensions of the shift amount,
and m_ZExtOrSExtOrSelf() may be exactly the tool to do that.

llvm-svn: 373128
llvm/include/llvm/IR/PatternMatch.h
llvm/unittests/IR/PatternMatch.cpp