diff options
| author | Jessica Paquette <jpaquette@apple.com> | 2020-02-03 14:26:17 -0800 |
|---|---|---|
| committer | Jessica Paquette <jpaquette@apple.com> | 2020-02-03 15:22:24 -0800 |
| commit | 9effe38b225f3dfd72d6f1800f2ea47175b5bf95 (patch) | |
| tree | ad5e5f447ff2eac136c484d3af92e1cd357c674e /clang/lib/Frontend/ASTMerge.cpp | |
| parent | 2252cac694f142c84f53a45793b325f5bef9124f (diff) | |
| download | llvm-9effe38b225f3dfd72d6f1800f2ea47175b5bf95.zip llvm-9effe38b225f3dfd72d6f1800f2ea47175b5bf95.tar.gz llvm-9effe38b225f3dfd72d6f1800f2ea47175b5bf95.tar.bz2 | |
[AArch64][GlobalISel] Fold G_XOR into TB(N)Z bit calculation
This ports the existing case for G_XOR from `getTestBitOperand` in
AArch64ISelLowering into GlobalISel.
The idea is to flip between TBZ and TBNZ while walking through G_XORs.
Let's say we have
```
tbz (xor x, c), b
```
Let's say the `b`-th bit in `c` is 1. Then
- If the `b`-th bit in `x` is 1, the `b`-th bit in `(xor x, c)` is 0.
- If the `b`-th bit in `x` is 0, then the `b`-th bit in `(xor x, c)` is 1.
So, then
```
tbz (xor x, c), b == tbnz x, b
```
Let's say the `b`-th bit in `c` is 0. Then
- If the `b`-th bit in `x` is 1, the `b`-th bit in `(xor x, c)` is 1.
- If the `b`-th bit in `x` is 0, then the `b`-th bit in `(xor x, c)` is 0.
So, then
```
tbz (xor x, c), b == tbz x, b
```
Differential Revision: https://reviews.llvm.org/D73929
Diffstat (limited to 'clang/lib/Frontend/ASTMerge.cpp')
0 files changed, 0 insertions, 0 deletions
