OSDN Git Service

In SimplifyDemandedUseBits, use computeKnownBits directly to handle Constants
authorCraig Topper <craig.topper@gmail.com>
Thu, 20 Apr 2017 16:14:58 +0000 (16:14 +0000)
committerCraig Topper <craig.topper@gmail.com>
Thu, 20 Apr 2017 16:14:58 +0000 (16:14 +0000)
commit1772e90779626a4efd449cb86fb243220278e5f6
treed477392100c54bc3bb6247750140259f1e14a2d2
parent503ce9f8c1327ba923273dcb6aeca6dadb96dcce
In SimplifyDemandedUseBits, use computeKnownBits directly to handle Constants

Currently we don't explicitly process ConstantDataSequential, ConstantAggregateZero, or ConstantVector, or Undef before applying the Depth limit. Instead they occur after the depth check in the non-instruction path.

For the constant types that we do handle, the code is replicated from computeKnownBits.

This patch fixes the missing constant handling and the reduces the amount of code by just using computeKnownBits directly for any type of Constant.

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

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