Commit d38bff4
authored
[AArch64] SimplifyDemandedBitsForTargetNode - add AArch64ISD::BICi handling (#76644)
Fold BICi if all destination bits are already known to be zeroes
```llvm
define <8 x i16> @haddu_known(<8 x i8> %a0, <8 x i8> %a1) {
%x0 = zext <8 x i8> %a0 to <8 x i16>
%x1 = zext <8 x i8> %a1 to <8 x i16>
%hadd = call <8 x i16> @llvm.aarch64.neon.uhadd.v8i16(<8 x i16> %x0, <8 x i16> %x1)
%res = and <8 x i16> %hadd, <i16 511, i16 511, i16 511, i16 511,i16 511, i16 511, i16 511, i16 511>
ret <8 x i16> %res
}
declare <8 x i16> @llvm.aarch64.neon.uhadd.v8i16(<8 x i16>, <8 x i16>)
```
```
haddu_known: // @haddu_known
ushll v0.8h, v0.8b, #0
ushll v1.8h, v1.8b, #0
uhadd v0.8h, v0.8h, v1.8h
bic v0.8h, #254, lsl #8 <-- this one will be removed as we know high bits are zero extended
ret
```
Fixes #53881
Fixes #536221 parent 4cb110a commit d38bff4
File tree
2 files changed
+30
-4
lines changed- llvm
- lib/Target/AArch64
- test/CodeGen/AArch64
2 files changed
+30
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24555 | 24555 | | |
24556 | 24556 | | |
24557 | 24557 | | |
| 24558 | + | |
| 24559 | + | |
| 24560 | + | |
| 24561 | + | |
| 24562 | + | |
| 24563 | + | |
| 24564 | + | |
| 24565 | + | |
| 24566 | + | |
| 24567 | + | |
| 24568 | + | |
| 24569 | + | |
24558 | 24570 | | |
24559 | 24571 | | |
24560 | 24572 | | |
| |||
27595 | 27607 | | |
27596 | 27608 | | |
27597 | 27609 | | |
| 27610 | + | |
| 27611 | + | |
| 27612 | + | |
| 27613 | + | |
| 27614 | + | |
| 27615 | + | |
| 27616 | + | |
| 27617 | + | |
| 27618 | + | |
| 27619 | + | |
| 27620 | + | |
| 27621 | + | |
| 27622 | + | |
| 27623 | + | |
| 27624 | + | |
| 27625 | + | |
| 27626 | + | |
| 27627 | + | |
27598 | 27628 | | |
27599 | 27629 | | |
27600 | 27630 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | | - | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| |||
42 | 40 | | |
43 | 41 | | |
44 | 42 | | |
45 | | - | |
46 | 43 | | |
47 | 44 | | |
48 | 45 | | |
| |||
57 | 54 | | |
58 | 55 | | |
59 | 56 | | |
60 | | - | |
61 | 57 | | |
62 | 58 | | |
63 | 59 | | |
| |||
0 commit comments