Yingwei Zheng
c727b48287
[SDAG][ISel][TableGen][LoongArch] Report error for trivial bitcasts when there are predicate calls ( #116075 )
...
On loongarch64 with lsx extension, we select `VBITREV_W` for `v4i32 (xor
X, (shl splat(1), Y))`:
8e66303916/llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td (L1583-L1584)
And `vsplat_imm_eq_1` is defined as:
8e66303916/llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td (L77-L87)
For the `(bitconvert (v4i32 (build_vector)))` case, the pattern is
expected to be:
```
PATTERN: (xor:{ *:[v4i32] } v4i32:{ *:[v4i32] }:$vj, (shl:{ *:[v4i32] } (bitconvert:{ *:[v4i32] } (build_vector:{ *:[v4i32] }))<<P:Predicate_vsplat_imm_eq_1>>, v4i32:{ *:[v4i32] }:$vk))
RESULT: (VBITREV_W:{ *:[v4i32] } v4i32:{ *:[v4i32] }:$vj, v4i32:{ *:[v4i32] }:$vk)
```
However, `simplifyTree` drops the `bitconvert` node and its predicates:
8e66303916/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp (L3036-L3062)
Then llvm will match `vsplat_imm_eq_1` for any v4i32 splats and cause a
miscompilation:
```
PATTERN: (xor:{ *:[v4i32] } v4i32:{ *:[v4i32] }:$vj, (shl:{ *:[v4i32] } (build_vector:{ *:[v4i32] }), v4i32:{ *:[v4i32] }:$vk))
RESULT: (VBITREV_W:{ *:[v4i32] } v4i32:{ *:[v4i32] }:$vj, v4i32:{ *:[v4i32] }:$vk)
```
This patch adds additional checks for predicates associated with the
trivial bitconvert node. Unused patterns in the LoongArch target are
also removed.
Fixes https://github.com/llvm/llvm-project/issues/116008 .
2024-11-19 21:24:40 +08:00
..
2024-10-31 15:58:15 +08:00
2024-11-12 19:07:53 +08:00
2024-11-19 21:24:40 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-06-03 13:23:35 +08:00
2024-05-14 20:23:04 +08:00
2024-07-22 15:10:21 +08:00
2024-10-16 11:58:00 +08:00
2024-09-06 16:19:20 +01:00
2024-06-03 13:23:35 +08:00
2024-05-14 20:23:04 +08:00
2024-08-08 23:05:38 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-10-31 15:58:15 +08:00
2024-10-31 15:58:15 +08:00
2024-10-31 15:58:15 +08:00
2024-08-19 15:23:05 +08:00
2024-11-01 00:08:15 +08:00
2024-05-14 20:23:04 +08:00
2024-07-23 15:14:20 +08:00
2024-10-31 15:58:15 +08:00
2024-09-06 15:46:43 +08:00
2024-10-31 15:58:15 +08:00
2024-11-06 17:34:13 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-11-11 16:46:22 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-06-12 17:41:26 +08:00
2024-05-14 20:23:04 +08:00
2024-11-01 00:08:15 +08:00
2024-07-30 14:22:53 +08:00
2024-10-31 15:58:15 +08:00
2024-08-09 14:08:32 +08:00
2024-08-08 23:05:38 +08:00
2024-11-06 17:34:13 +08:00
2024-09-13 08:49:54 +08:00
2024-08-15 14:09:36 +08:00
2024-11-06 09:26:28 +08:00
2024-10-31 15:58:15 +08:00
2024-05-14 20:23:04 +08:00
2024-10-31 15:58:15 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-10-31 15:58:15 +08:00
2024-08-08 23:05:38 +08:00
2024-08-08 23:05:38 +08:00
2024-08-08 23:05:38 +08:00
2024-08-30 16:38:42 +08:00
2024-10-31 15:58:15 +08:00
2024-08-08 23:05:38 +08:00
2024-05-14 20:23:04 +08:00
2024-08-08 23:05:38 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-10-31 15:58:15 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-06-07 15:39:05 +08:00
2024-10-31 15:58:15 +08:00
2024-05-14 20:23:04 +08:00
2024-06-07 15:39:05 +08:00
2024-11-11 14:15:22 +08:00
2024-06-12 22:02:47 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-17 09:13:51 +08:00
2024-05-14 20:23:04 +08:00
2024-08-08 23:05:38 +08:00
2024-05-14 20:23:04 +08:00
2024-10-23 19:43:23 +08:00
2024-11-06 19:30:57 +08:00
2024-05-14 20:23:04 +08:00
2024-10-18 09:35:42 +04:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-08-29 17:53:32 +01:00
2024-11-07 10:10:28 +01:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-08-08 23:05:38 +08:00
2024-06-12 22:02:47 +08:00
2024-05-14 20:23:04 +08:00
2024-07-30 14:22:24 +08:00
2024-07-16 20:56:18 +01:00
2024-05-14 20:23:04 +08:00
2024-06-03 13:23:35 +08:00
2024-05-14 20:23:04 +08:00
2024-10-31 15:58:15 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-10-31 15:58:15 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-10-31 15:58:15 +08:00
2024-10-31 15:58:15 +08:00
2024-05-14 20:23:04 +08:00
2024-10-31 15:58:15 +08:00
2024-10-31 15:58:15 +08:00
2024-10-31 15:58:15 +08:00
2024-05-16 16:54:18 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-07-30 14:22:53 +08:00
2024-05-14 20:23:04 +08:00
2024-07-17 12:21:44 +08:00
2024-07-31 17:18:27 -07:00
2024-05-14 20:23:04 +08:00
2024-08-02 11:28:03 +08:00
2024-10-31 15:58:15 +08:00
2024-10-31 15:58:15 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00