quic_abhikran via llvm-dev
2020-Apr-14 19:58 UTC
[llvm-dev] Failure while running loop vectorizer
Hi, While trying to compile my program, I faced problem with Loop Vectorizer which is trying interleave a load instruction. Error mentioned below Error message :: void llvm::InnerLoopVectorizer::vectorizeMemoryInstruction(llvm::Instruction*, llvm::VPTransformState&, llvm::VPValue*, llvm::VPValue*, llvm::VPValue*): Assertion `(Decision == LoopVectorizationCostModel::CM_Widen || Decision == LoopVectorizationCostModel::CM_Widen_Reverse || Decision == LoopVectorizationCostModel::CM_GatherScatter) && "CM decision is not to widen the memory instruction"' failed. Source code :: https://github.com/llvm/llvm-project/blob/master/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp#L2375 I have reduced my program to a shorter test case(vect.ll is attached). The same problem is reproducible with opt. Command to reproduce the error: ./opt -loop-vectorize -hexagon-autohvx=1 vect.ll -S Based on my analysis, I see that Decision<https://github.com/llvm/llvm-project/blob/master/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp#L2370> is getting return value as CM_Interleave but Loop Vectorizer expects either of the following values: CM_Widen, CM_Widen_Reverse, CM_GatherScatter. Otherwise it asserts out. Could you please help in sharing insights on what could be an issue here ? Thanks, Abhikrant -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200414/f60939f2/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: vect.ll Type: application/octet-stream Size: 2748 bytes Desc: vect.ll URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200414/f60939f2/attachment.obj>