[Reassociate] replace fake binop queries with 'match' API
authorSanjay Patel <spatel@rotateright.com>
Tue, 23 Oct 2018 15:55:06 +0000 (15:55 +0000)
committerSanjay Patel <spatel@rotateright.com>
Tue, 23 Oct 2018 15:55:06 +0000 (15:55 +0000)
commit5b6b090cf2129228f05d7d0f504676b67f7524cf
tree6a663521cf03804e16d13999030aa8adf93b56af
parentad12df829ce16ff016a9d9dd16c3ab1c0a3bc513
[Reassociate] replace fake binop queries with 'match' API

We need to update this code before introducing an 'fneg' instruction in IR,
so we might as well kill off the integer neg/not queries too.

This is no-functional-change-intended for scalar code and most vector code.
For vectors, we can see that the 'match' API allows for undef elements in
constants, so we optimize those cases better.

Ideally, there would be a test for each code diff, but I don't see evidence
of that for the existing code, so I didn't try very hard to come up with new
vector tests for each code change.

Differential Revision: https://reviews.llvm.org/D53533

llvm-svn: 345042
llvm/lib/Transforms/Scalar/Reassociate.cpp
llvm/test/Transforms/Reassociate/inverses.ll
llvm/test/Transforms/Reassociate/negation.ll