diff options
| author | Jessica Paquette <jpaquette@apple.com> | 2020-12-08 09:34:42 -0800 |
|---|---|---|
| committer | Jessica Paquette <jpaquette@apple.com> | 2020-12-08 10:42:59 -0800 |
| commit | cd9a52b99e685e8a77dd85d25c7d1ec8b86b9f55 (patch) | |
| tree | 2e8285e408cc20981e82ea866291c4417211c1f1 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | |
| parent | ce199667f65bcddc31c8c4be2b723f9132815fe6 (diff) | |
[AArch64][GlobalISel] Fold binops on the true side of G_SELECT
This implements the following folds:
```
G_SELECT cc, (G_SUB 0, %x), %false -> CSNEG %x, %false, inv_cc
G_SELECT cc, (G_XOR x, -1), %false -> CSINV %x, %false, inv_cc
```
This is similar to the folds introduced in
5bc0bd05e6a8d788e08cdf3d154f3a33202aee53.
In 5bc0bd05e6a8d788e08cdf3d154f3a33202aee53 I mentioned that we may prefer to do
this in AArch64PostLegalizerLowering.
I think that it's probably better to do this in the selector. The way we select
G_SELECT depends on what register banks end up being assigned to it. If we did
this in AArch64PostLegalizerLowering, then we'd end up checking *every* G_SELECT
to see if it's worth swapping operands. Doing it in the selector allows us to
restrict the optimization to only relevant G_SELECTs.
Also fix up some comments in `TryFoldBinOpIntoSelect` which are kind of
confusing IMO.
Example IR: https://godbolt.org/z/3qPGca
Differential Revision: https://reviews.llvm.org/D92860
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
0 files changed, 0 insertions, 0 deletions
