It is new vectorization optimization which needs middle-end patches. I believe you didn't apply these following 2 patches: https://gcc.gnu.org/pipermail/gcc-patches/2023-October/634812.html https://gcc.gnu.org/pipermail/gcc-patches/2023-October/634813.html
juzhe.zh...@rivai.ai From: Patrick O'Neill Date: 2023-11-01 13:23 To: Juzhe-Zhong CC: kito.cheng; kito.cheng; jeffreyalaw; Robin Dapp; gcc-patches Subject: Re: [PATCH] RISC-V: Support strided load/store Hi Juzhe, The pre-commit CI is seeing these new failures after applying this patch [1]: FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/mask_strided_load-1.c scan-tree-dump-times optimized " .MASK_LEN_STRIDED_LOAD" 132 FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/mask_strided_store-1.c scan-tree-dump-times optimized " .MASK_LEN_STRIDED_LOAD" 66 FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/mask_strided_store-1.c scan-tree-dump-times optimized " .MASK_LEN_STRIDED_STORE" 66 FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/strided_load-1.c scan-tree-dump-times optimized " .MASK_LEN_STRIDED_LOAD" 66 FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/strided_load-3.c scan-tree-dump-times optimized " .MASK_LEN_STRIDED_LOAD" 55 FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/strided_store-1.c scan-tree-dump-times optimized " .MASK_LEN_STRIDED_STORE" 66 FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/strided_store-2.c scan-tree-dump-times optimized " .MASK_LEN_STRIDED_STORE" 44 FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/strided_store-3.c scan-tree-dump-times optimized " .MASK_LEN_STRIDED_STORE" 55 Example debug log: Executing on host: /home/runner/work/gcc-precommit-ci/gcc-precommit-ci/riscv-gnu-toolchain/build/build-gcc-linux-stage2/gcc/xgcc -B/home/runner/work/gcc-precommit-ci/gcc-precommit-ci/riscv-gnu-toolchain/build/build-gcc-linux-stage2/gcc/ /home/runner/work/gcc-precommit-ci/gcc-precommit-ci/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/gather-scatter/strided_store-3.c -march=rv32gc_zba_zbb_zbc_zbs -mabi=ilp32d -mcmodel=medlow -fdiagnostics-plain-output -march=rv64gcv_zvfh -mabi=lp64d -O3 --param riscv-autovec-preference=scalable -fno-vect-cost-model -ffast-math -fdump-tree-optimized-details -S -o strided_store-3.s (timeout = 600) spawn -ignore SIGHUP /home/runner/work/gcc-precommit-ci/gcc-precommit-ci/riscv-gnu-toolchain/build/build-gcc-linux-stage2/gcc/xgcc -B/home/runner/work/gcc-precommit-ci/gcc-precommit-ci/riscv-gnu-toolchain/build/build-gcc-linux-stage2/gcc/ /home/runner/work/gcc-precommit-ci/gcc-precommit-ci/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/gather-scatter/strided_store-3.c -march=rv32gc_zba_zbb_zbc_zbs -mabi=ilp32d -mcmodel=medlow -fdiagnostics-plain-output -march=rv64gcv_zvfh -mabi=lp64d -O3 --param riscv-autovec-preference=scalable -fno-vect-cost-model -ffast-math -fdump-tree-optimized-details -S -o strided_store-3.s PASS: gcc.target/riscv/rvv/autovec/gather-scatter/strided_store-3.c (test for excess errors) gcc.target/riscv/rvv/autovec/gather-scatter/strided_store-3.c: pattern found 0 times FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/strided_store-3.c scan-tree-dump-times optimized " .MASK_LEN_STRIDED_STORE" 55 PASS: gcc.target/riscv/rvv/autovec/gather-scatter/strided_store-3.c scan-tree-dump-not optimized " .SCATTER_STORE" PASS: gcc.target/riscv/rvv/autovec/gather-scatter/strided_store-3.c scan-tree-dump-not optimized " .MASK_SCATTER_STORE" If these failures are due to the missing middle-end bits then feel free to ignore :-) Thanks, Patrick [1]: https://github.com/ewlu/gcc-precommit-ci/issues/524#issuecomment-1787004837 On 10/31/23 13:26, Robin Dapp wrote: Hi Juzhe, LGTM once the middle-end parts are in. Just tiny nits. Nothing that would warrant a V2, though. +;; ========================================================================= +;; == Stried Load/Store missing a 'd' here. +(define_predicate "vector_stride_extension_operand" + (ior (and (match_operand 0 "immediate_operand") + (match_test "Pmode == DImode")) + (and (match_operand 0 "const_0_operand") + (match_test "Pmode == SImode")))) + This could use a comment why we allow only sign extension for 32 bit. Also the linter complains about spaces vs tabs. Regards Robin