Re: [PATCH v4] RISC-V: Fix code gen for reduction with length 0 [PR118182]

2025-01-14 Thread Kito Cheng
committed to trunk On Mon, Jan 6, 2025 at 6:06 PM Kito Cheng wrote: > > `.MASK_LEN_FOLD_LEFT_PLUS`(or `mask_len_fold_left_plus_m`) is expecting the > return value will be the start value even if the length is 0. > > However current code gen in RISC-V backend is not meet that semantic, it will > r

[PATCH v4] RISC-V: Fix code gen for reduction with length 0 [PR118182]

2025-01-06 Thread Kito Cheng
`.MASK_LEN_FOLD_LEFT_PLUS`(or `mask_len_fold_left_plus_m`) is expecting the return value will be the start value even if the length is 0. However current code gen in RISC-V backend is not meet that semantic, it will result a random garbage value if length is 0. Let example by current code gen for