-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
Labels
crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]vectorizers
Description
In #105722 , we resolved the assertion failure in vectorization. However, I met this crash again with the following case:
#include <stdint.h>
int a;
long b;
struct e {
uint16_t f;
uint64_t g;
int32_t h
} static i = {65530};
void c(int d) {
for (; a; a++)
b *= d;
}
uint32_t j(struct e, uint16_t);
uint64_t k() { j(i, 0); }
uint32_t j(struct e, uint16_t) { c(i.f - 65528); }
I compiled it with -O2 flag and it crashed. But when I compiled with -O1/-O0, it worked.
The crash is: clang++: /root/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:7359: llvm::VectorizationFactor llvm::LoopVectorizationPlanner::computeBestVF(): Assertion `(BestFactor.Width == LegacyVF.Width || planContainsAdditionalSimplifications(getPlanFor(BestFactor.Width), BestFactor.Width, CostCtx, OrigLoop, CM)) && " VPlan cost model and legacy cost model disagreed"' failed.
The details can be found here: https://godbolt.org/z/8x48xsKs6
Metadata
Metadata
Assignees
Labels
crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]vectorizers