[all-commits] [llvm/llvm-project] 2718a4: [LoongArch] Lower vector select mask generation to...
hev via All-commits
all-commits at lists.llvm.org
Thu Jun 5 07:18:01 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 2718a47f4952f91f3f076242b8b6cad4b7934e9d
https://github.com/llvm/llvm-project/commit/2718a47f4952f91f3f076242b8b6cad4b7934e9d
Author: hev <wangrui at loongson.cn>
Date: 2025-06-05 (Thu, 05 Jun 2025)
Changed paths:
M llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
M llvm/lib/Target/LoongArch/LoongArchISelLowering.h
M llvm/lib/Target/LoongArch/LoongArchLASXInstrInfo.td
M llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td
M llvm/test/CodeGen/LoongArch/lasx/xvmskcond.ll
M llvm/test/CodeGen/LoongArch/lsx/vmskcond.ll
Log Message:
-----------
[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.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list