Skip to content

[DAG] computeKnownBits/ComputeNumSignBits - add ISD::VECTOR_COMPRESS integer vector types handling and test coverage #158332

@RKSimon

Description

@RKSimon
  /// VECTOR_COMPRESS(Vec, Mask, Passthru)
  /// consecutively place vector elements based on mask
  /// e.g., vec = {A, B, C, D} and mask = {1, 0, 1, 0}
  ///         --> {A, C, ?, ?} where ? is undefined
  /// If passthru is defined, ?s are replaced with elements from passthru.
  /// If passthru is undef, ?s remain undefined.
  VECTOR_COMPRESS,

computeKnownBits should return the common knownbits between the Vec and PassThru values

ComputeNumSignBits should return the minimum of the num signbits of the Vec and PassThru values

If PassThru is undef you should earlyout and return knownbits = unknown / signbits = 1

You should probably ignore the computeKnownBits/ComputeNumSignBits DemandedElts parameter and analyse all vector elements of both operands.

Metadata

Metadata

Assignees

Labels

good first issuehttps://github.com/llvm/llvm-project/contributellvm:SelectionDAGSelectionDAGISel as well

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions