This is an archive of the discontinued LLVM Phabricator instance.

[SLP] Fix infinite loop in isUndefVector.
ClosedPublic

Authored by fhahn on Feb 17 2023, 12:34 PM.

Details

Summary

This fixes an infinite loop if isa<T>(II->getOperand(1)) is true.
Return an all-0 bitvector, which is done along other error paths instead
of the continue, which leads to an infinite loop because Base
is not updated.

Diff Detail

Event Timeline

fhahn created this revision.Feb 17 2023, 12:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2023, 12:34 PM
fhahn requested review of this revision.Feb 17 2023, 12:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2023, 12:34 PM
ABataev added inline comments.Feb 17 2023, 12:48 PM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
379

Move Base = II->getOperand(0); before the if statement instead, it is not an error path

fhahn updated this revision to Diff 498597.Feb 18 2023, 10:06 AM

Keep continue, move updating Base to top of loop.

fhahn marked an inline comment as done.Feb 18 2023, 10:07 AM
fhahn added inline comments.
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
379

Updated, it looks like we are still missing test coverage for cases where it actually makes a difference though.

This revision is now accepted and ready to land.Feb 18 2023, 11:29 AM
This revision was landed with ongoing or failed builds.Feb 19 2023, 1:43 PM
This revision was automatically updated to reflect the committed changes.
fhahn marked an inline comment as done.