[InstCombine] MakeAnd/Or/Xor handling to reuse previous APInt computations
authorCraig Topper <craig.topper@gmail.com>
Fri, 14 Apr 2017 22:34:14 +0000 (22:34 +0000)
committerCraig Topper <craig.topper@gmail.com>
Fri, 14 Apr 2017 22:34:14 +0000 (22:34 +0000)
commit9a458cd51765131f38b04816a05e776323a68af9
tree08583b20d9b511119df2a3e5e58d2cb130d1021c
parent49a28fdafb4603ed4e25c65e841db9365c936b43
[InstCombine] MakeAnd/Or/Xor handling to reuse previous APInt computations

When checking if we should return a constant, we create some temporary APInts to see if we know all bits. But the exact computations we do are needed in several other locations in the same code.

This patch moves them to named temporaries so we can reuse them.

Ideally we'd write directly to KnownZero/One, but we currently seem to only write those variables after all the simplifications checks and I didn't want to change that with this patch.

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

llvm-svn: 300376
llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp