https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127910
Bug ID: 127910
Summary: full O3 vectorizer cost model slows down SpecCPU'26
zstd
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: andi-gcc at firstfloor dot org
Target Milestone: ---
Created attachment 65849
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65849&action=edit
reduced reproducer
Disabling the vectorizer (over -O3) or setting the cost model to cheap speeds
up SpecCPU'26 zstd slightly on a Intel PantherLake/Pcore. seen with 16.0 and
trunk.
Attached is an (AI generated) reduced reproducer.┘
With cheap this loop is not vectorized.
if (input < loop_limit) {
size_t diff = load_word(match) ^ load_word(input);
if (diff != 0)
return common_bytes(diff);
input += sizeof(size_t);
match += sizeof(size_t);
while (input < loop_limit) {
diff = load_word(match) ^ load_word(input);
if (diff == 0) {
input += sizeof(size_t);
match += sizeof(size_t);
continue;
}
input += common_bytes(diff);
return (size_t)(input - start);
}
}