Add support to paternmatch for simple const Value cases.
authorPete Cooper <peter_cooper@apple.com>
Fri, 12 Aug 2016 22:16:05 +0000 (22:16 +0000)
committerPete Cooper <peter_cooper@apple.com>
Fri, 12 Aug 2016 22:16:05 +0000 (22:16 +0000)
commitab47fa643b77923322368dc2b8f277080c988c98
treed928a27a487910f246f3df6a8118485af1fb98e7
parente78e32a443aaaba63d081faaed7e2cb881424458
Add support to paternmatch for simple const Value cases.

Pattern match has some paths which can operate on constant instructions,
but not all.  This adds a version of m_value() to return const Value* and
changes ICmp matching to use auto so that it can match both constant and
mutable instructions.

Tests also included for both mutable and constant ICmpInst matching.

This will be used in a future commit to constify ValueTracking.cpp.

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