diff options
author | Yingwei Zheng <dtcxzyw2333@gmail.com> | 2024-02-23 00:18:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-23 00:18:56 +0800 |
commit | 0107c8824b695db86706bbc3466bbfd585a754aa (patch) | |
tree | 005e12562c0fb80e5d9ec47e249890b98a2cfe92 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 9eb5f94f9b47154cf07160a6ba74ab1c31becfa3 (diff) | |
download | llvm-0107c8824b695db86706bbc3466bbfd585a754aa.zip llvm-0107c8824b695db86706bbc3466bbfd585a754aa.tar.gz llvm-0107c8824b695db86706bbc3466bbfd585a754aa.tar.bz2 |
[RISCV][SDAG] Improve codegen of select with constants if zicond is available (#82456)
This patch uses `add + czero.eqz/nez` to lower select with constants if
zicond is available.
```
(select c, c1, c2) -> (add (czero_nez c2 - c1, c), c1)
(select c, c1, c2) -> (add (czero_eqz c1 - c2, c), c2)
```
The above code sequence is suggested by [RISCV Optimization
Guide](https://riscv-optimization-guide-riseproject-c94355ae3e6872252baa952524.gitlab.io/riscv-optimization-guide.html#_avoid_branches_using_conditional_moves).
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions