[PatternMatch] Do not match constant expressions for binops
Currently, m_Mul() style matchers also match constant expressions. This is a regular source of assertion failures (usually by trying to do a match and then cast to Instruction or BinaryOperator) and infinite combine loops. At the same time, I don't think this provides useful optimization capabilities (all of the tests affected here are regression tests for crashes / infinite loops). Long term, all of these constant expressions (apart from possibly add/sub) are slated for removal per https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179 -- but doing those removals can itself expose new crashes and infinite loops due to the current PatternMatch behavior. Differential Revision: https://reviews.llvm.org/D156401
Loading
Please sign in to comment