History log of /llvm-project/llvm/test/CodeGen/ARM/scmp.ll (Results 1 – 1 of 1)
Revision Date Author Comments
# e094abde 16-Jul-2024 Volodymyr Vasylkun <vvmposeydon@gmail.com>

[SelectionDAG] Expand [US]CMP using arithmetic on boolean values instead of selects (#98774)

The previous expansion of [US]CMP was done using two selects and two
compares. It produced decent code,

[SelectionDAG] Expand [US]CMP using arithmetic on boolean values instead of selects (#98774)

The previous expansion of [US]CMP was done using two selects and two
compares. It produced decent code, but on many platforms it is better to
implement [US]CMP nodes by performing the following operation:

```
[us]cmp(x, y) = (x [us]> y) - (x [us]< y)
```

This patch adds this new expansion, as well as a hook in TargetLowering to allow some targets to still use the select-based approach. AArch64 and SystemZ are currently the only targets to prefer the former approach, but other targets may also start to use it if it provides for better codegen.

show more ...