[llvm] [X86] Generate `kmov` for masking integers (PR #120593)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 20 05:58:39 PST 2024
abhishek-kaushik22 wrote:
> Tests need some cleanup/simplification - ideally its good to precommit the tests with current codegen and then show the codegen change when the combine is added in a later commit.
Thanks, I'll take care next time.
> What was the reason behind performing this in DAGToDAG and not as a regular DAG combine?
I wasn't sure what this could be combined to, I didn't find any useful patterns that gets selected as KMOV. I only see these patterns in tablegen.
```
/*544207*/ OPC_MorphNodeTo1None, TARGET_VAL(X86::KMOVWkr),
/*MVT::v16i1*/22, 1/*#Ops*/, 5,
// Src: (insert_subvector:{ *:[v16i1] } immAllZerosV:{ *:[v16i1] }, (scalar_to_vector:{ *:[v1i1] } GR8:{ *:[i8] }:$src), 0:{ *:[iPTR] }) - Complexity = 15
// Dst: (KMOVWkr:{ *:[v16i1] } (AND32ri:{ *:[i32] }:{ *:[i32] } (INSERT_SUBREG:{ *:[i32] } (IMPLICIT_DEF:{ *:[i32] }), GR8:{ *:[i8] }:$src, sub_8bit:{ *:[i32] }), 1:{ *:[i32] }))
```
If there's a simpler pattern that I missed, please let me know.
https://github.com/llvm/llvm-project/pull/120593
More information about the llvm-commits
mailing list