[Bug target/113281] [14] RISC-V rv64gcv_zvl256b vector: Runtime mismatch with rv64gc

2024-01-08 Thread juzhe.zhong at rivai dot ai via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113281 --- Comment #5 from JuzheZhong --- (In reply to JuzheZhong from comment #4) > Confirm reduced case: > > #include > unsigned char a; > > int main() { > short b = a = 0; > for (; a != 19; a++) > if (a) > b = 32872 >> a; > >

[Bug target/113281] [14] RISC-V rv64gcv_zvl256b vector: Runtime mismatch with rv64gc

2024-01-08 Thread juzhe.zhong at rivai dot ai via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113281 --- Comment #4 from JuzheZhong --- Confirm reduced case: #include unsigned char a; int main() { short b = a = 0; for (; a != 19; a++) if (a) b = 32872 >> a; assert (b == 0); } with -fno-vect-cost-model -march=rv64gcv -O3:

[Bug target/113281] [14] RISC-V rv64gcv_zvl256b vector: Runtime mismatch with rv64gc

2024-01-08 Thread juzhe.zhong at rivai dot ai via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113281 --- Comment #3 from JuzheZhong --- I think there are 2 issues here: 1. We should adjust cost model to let loop vectorizer eliminate the unprofitable vectorization. It should be done in RISC-V backend. 2. We should fix run fail bug with

[Bug target/113281] [14] RISC-V rv64gcv_zvl256b vector: Runtime mismatch with rv64gc

2024-01-08 Thread rdapp at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113281 --- Comment #2 from Robin Dapp --- Confirmed. Funny, we shouldn't vectorize that but really optimize to "return 0". Costing might be questionable but we also haven't optimized away the loop when comparing costs. Disregarding that, of course

[Bug target/113281] [14] RISC-V rv64gcv_zvl256b vector: Runtime mismatch with rv64gc

2024-01-08 Thread patrick at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113281 Patrick O'Neill changed: What|Removed |Added Keywords||wrong-code CC|