[PATCH] D48025: [PowerPC] avoid masking already-zero bits in BitPermutationSelector

Hiroshi Inoue via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 11 07:11:47 PDT 2018


inouehrs created this revision.
inouehrs added reviewers: hfinkel, echristo, kbarton, nemanjai.

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` is also 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).


https://reviews.llvm.org/D48025

Files:
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48025.150742.patch
Type: text/x-patch
Size: 12969 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180611/2bb2fb5a/attachment.bin>


More information about the llvm-commits mailing list