diff options
author | Pan Li <pan2.li@intel.com> | 2023-09-17 15:16:47 +0800 |
---|---|---|
committer | Pan Li <pan2.li@intel.com> | 2023-09-19 06:59:57 +0800 |
commit | 28f16f6d9b4fc1391275f4ba24dc2019ee64fc22 (patch) | |
tree | 406049ff8f2cd021a434591de22a457cdad9ab01 /libobjc | |
parent | 7ea501d3ea698e1c845fb61e3487f4cd949e6253 (diff) | |
download | gcc-28f16f6d9b4fc1391275f4ba24dc2019ee64fc22.zip gcc-28f16f6d9b4fc1391275f4ba24dc2019ee64fc22.tar.gz gcc-28f16f6d9b4fc1391275f4ba24dc2019ee64fc22.tar.bz2 |
RISC-V: Bugfix for scalar move with merged operand
Given below example for VLS mode
void
test (vl_t *u)
{
vl_t t;
long long *p = (long long *)&t;
p[0] = p[1] = 2;
*u = t;
}
The vec_set will simplify the insn to vmv.s.x when index is 0, without
merged operand. That will result in some problems in DCE, aka:
1: 137[DI] = a0
2: 138[V2DI] = 134[V2DI] // deleted by DCE
3: 139[DI] = #2 // deleted by DCE
4: 140[DI] = #2 // deleted by DCE
5: 141[V2DI] = vec_dup:V2DI (139[DI]) // deleted by DCE
6: 138[V2DI] = vslideup_imm (138[V2DI], 141[V2DI], 1) // deleted by DCE
7: 135[V2DI] = 138[V2DI] // deleted by DCE
8: 142[V2DI] = 135[V2DI] // deleted by DCE
9: 143[DI] = #2
10: 142[V2DI] = vec_dup:V2DI (143[DI])
11: (137[DI]) = 142[V2DI]
The higher 64 bits of 142[V2DI] is unknown here and it generated incorrect
code when store back to memory. This patch would like to fix this issue
by adding a new SCALAR_MOVE_MERGED_OP for vec_set.
Please note this patch doesn't enable VLS for vec_set, the underlying
patches will support this soon.
gcc/ChangeLog:
* config/riscv/autovec.md: Bugfix.
* config/riscv/riscv-protos.h (SCALAR_MOVE_MERGED_OP): New enum.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/base/scalar-move-merged-run-1.c: New test.
Signed-off-by: Pan Li <pan2.li@intel.com>
Diffstat (limited to 'libobjc')
0 files changed, 0 insertions, 0 deletions