OSDN Git Service

[PowerPC] avoid masking already-zero bits in BitPermutationSelector
authorHiroshi Inoue <inouehrs@jp.ibm.com>
Fri, 12 Oct 2018 14:02:20 +0000 (14:02 +0000)
committerHiroshi Inoue <inouehrs@jp.ibm.com>
Fri, 12 Oct 2018 14:02:20 +0000 (14:02 +0000)
commit706d3da44f2997d8fada9a5cd3ef89cf91883ccf
tree3a5f6a5ad6a89fffdcdcdaa2e3d8fbdaea29107e
parent29956bffea8f12634f457488cfe5071fed92d120
[PowerPC] avoid masking already-zero bits in BitPermutationSelector

The current BitPermutationSelector generates a code to build a value by tracking two types of bits: ConstZero and Variable.
ConstZero means a bit we need to mask off and Variable is a bit we copy from an input value.

This patch add third type of bits VariableKnownToBeZero caused by AssertZext node or zero-extending load node.
VariableKnownToBeZero means a bit comes from an input value, but it is known to be already zero. So we do not need to mask them.
VariableKnownToBeZero enhances flexibility to group bits, since we can avoid redundant masking for these bits.

This patch also renames "HasZero" to "NeedMask" since now we may skip masking even when we have zeros (of type VariableKnownToBeZero).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344347 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCISelDAGToDAG.cpp
test/CodeGen/PowerPC/addi-offset-fold.ll
test/CodeGen/PowerPC/bitfieldinsert.ll
test/CodeGen/PowerPC/ppc64le-aggregates.ll
test/CodeGen/PowerPC/rlwimi-dyn-and.ll