OSDN Git Service

[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)
commit61f35170e7a8d0438436c5ca77fdb34a736e2809
tree0b6076ed6a021365a90e43483f4a9302c01347c7
parentce27c612e600a63f34dce934229539cd7aea8da3
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300376 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp