Message ID | 66C3107A4A476C91+202402261456221099863@rivai.ai |
---|---|
State | New |
Headers | show |
Series | RISC-V: add option -m(no-)autovec-segment | expand |
diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index 1dbe1115da4..6303d82d959 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -11521,7 +11521,8 @@ vectorizable_load (vec_info *vinfo, - (vec_num * j + i) * nunits); /* remain should now be > 0 and < nunits. */ unsigned num; - if (constant_multiple_p (nunits, remain, &num)) + if (known_gt (remain, 0) + && constant_multiple_p (nunits, remain, &num)) Why do you change loop vectorize code here ? Ideally, we should add cost model for segment load/store instead of disable segment load/store autovectorization with compile option.