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.