This is an archive of the discontinued LLVM Phabricator instance.

[SLP][NFC] Cleanup: Outline the code that vectorizes CmpInsts into a seaparate function.
ClosedPublic

Authored by vporpo on May 4 2023, 6:15 PM.

Diff Detail

Event Timeline

vporpo created this revision.May 4 2023, 6:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2023, 6:15 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
vporpo requested review of this revision.May 4 2023, 6:15 PM
ABataev added inline comments.May 5 2023, 5:41 AM
llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h
148

ArrayRef<Value *>

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
14433

try to replace with dyn_cast

vporpo added inline comments.May 5 2023, 9:23 AM
llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h
148

Isn't it better to use ArrayRef<CmpInst *> instead of ArrayRef<Value *> ?

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
14433

What do you mean? Like this?

auto *Select = dyn_cast<SelectInst>(U);
return Select && Select->getParent() != cast<Instruction>(V)->getParent();
ABataev added inline comments.May 5 2023, 9:25 AM
llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h
148

Yes, I mean use ArrayRef instead of const SmallVector &

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
14433

Yes

vporpo updated this revision to Diff 519899.May 5 2023, 9:36 AM

Addressed comments.

This revision is now accepted and ready to land.May 5 2023, 9:39 AM
This revision was landed with ongoing or failed builds.May 5 2023, 9:57 AM
This revision was automatically updated to reflect the committed changes.