llvm-project
2718a47f - [LoongArch] Lower vector select mask generation to `[X]VMSK{LT,GE,NE}Z` if possible (#142109)

Commit
194 days ago
[LoongArch] Lower vector select mask generation to `[X]VMSK{LT,GE,NE}Z` if possible (#142109) This patch adds a DAG combine rule for BITCAST nodes converting from vector `i1` masks generated by `setcc` into integer vector types. It recognizes common select mask patterns and lowers them into efficient LoongArch LSX/LASX mask instructions such as: - [X]VMSKLTZ.{B,H,W,D} - [X]VMSKGEZ.B - [X]VMSKNEZ.B When the vector comparison matches specific patterns (e.g., x < 0, x >= 0, x != 0, etc.), the transformation is performed pre-legalization. This avoids scalarization and unnecessary operations, improving both performance and code size.
Author
Parents
Loading