llvm-project
52dfba67 - [LoongArch] Mark VPICK_ZEXT_ELT as zero-extending in computeKnownBits

Commit
6 days ago
[LoongArch] Mark VPICK_ZEXT_ELT as zero-extending in computeKnownBits Teach computeKnownBitsForTargetNode that VPICK_ZEXT_ELT produces a zero-extended result. VPICK_ZEXT_ELT extracts a narrower element (e.g. i16) and returns it in a larger integer type (e.g. i64) with the upper bits guaranteed to be zero. However, without KnownBits information, LLVM treats the upper bits as unknown, which inhibits optimizations. By marking all bits above the source element width as known zero, this enables DAG combine and other optimizations to eliminate redundant operations such as AND masks and SIGN_EXTEND_INREG. For example, this allows patterns like: (sign_extend_inreg (VPICK_ZEXT_ELT ...), i32) to be simplified when the sign bit is known to be zero.
Author
Committer
Parents
Loading