This is an archive of the discontinued LLVM Phabricator instance.

[SLP] Set ExtendingManyInputs argument of addMask based on size of InVectors (PR63668)
Needs ReviewPublic

Authored by vedant-amd on Jul 14 2023, 1:56 AM.

Details

Summary

In the finalize function, addMask is always called with
ExtendingManyInputs=true, this need not be always true. In case size of
InVectors is 1, then there is just one input, and this option being
passed, triggers an assert in the addMask function.

void addMask(llvm::SmallVectorImpl<int>&, llvm::ArrayRef<int>, bool):
Assertion `(!ExtendingManyInputs || SubMask.size() > Mask.size()) &&
"SubMask with many inputs support must be larger than the mask."'
failed.

This patch, adds a check on the size of InVectors to set the
ExtendingManyInputs flag and also adds a testcase to exhibit the issue.
This issue was also reported in PR#63668 and fixes it.

Diff Detail

Event Timeline

vedant-amd created this revision.Jul 14 2023, 1:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2023, 1:56 AM
vedant-amd requested review of this revision.Jul 14 2023, 1:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2023, 1:56 AM

Updated patch after running through clang-format

Hi, thanks for the patch, but it is not quite correct. I going to commit a fix in a few minutes with your test (just need to fix assertion check, actually)

vedant-amd added a comment.EditedJul 14 2023, 6:34 AM

Hi, thanks for the patch, but it is not quite correct. I going to commit a fix in a few minutes with your test (just need to fix assertion check, actually)

I see, I had thought about that, but there was limited information about what it expects of the Mask and SubMask. If you haven't added the patch yet. I can update my patch ?