[all-commits] [llvm/llvm-project] 52b184: [VP][DAGCombine] Use `simplifySelect` when combini...

AinsleySnow via All-commits all-commits at lists.llvm.org
Wed Apr 3 04:46:12 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 52b18430ae105566f26152c0efc63998301b1134
      https://github.com/llvm/llvm-project/commit/52b18430ae105566f26152c0efc63998301b1134
  Author: AinsleySnow <772571228 at qq.com>
  Date:   2024-04-03 (Wed, 03 Apr 2024)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/RISCV/rvv/vselect-vp.ll

  Log Message:
  -----------
  [VP][DAGCombine] Use `simplifySelect` when combining vp.select. (#87342)

Hi all,

This patch is a follow-up of #79101. It migrates logic from
`visitVSELECT` to `visitVP_SELECT` to simplify `vp.select`. With this
patch we can do the following combinations:

```
vp.select undef, T, F --> T (if T is a constant), F otherwise
vp.select <condition>, undef, F --> F
vp.select <condition>, T, undef --> T
vp.select false, T, F --> F
vp.select <condition>, T, T --> T
```

I'm a total newbie to llvm and I'm sure there's room for improvements in
this patch. Please let me know if you have any advice. Thank you in
advance!



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