Skip to content

Commit abe1bc9

Browse files
committed
ix the index constraint to accept -1 as valid index
1 parent 5f98861 commit abe1bc9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/CIR/Dialect/IR/CIRDialect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1602,7 +1602,7 @@ LogicalResult cir::VecShuffleOp::verify() {
16021602
const uint64_t maxValidIndex =
16031603
getVec1().getType().getSize() + getVec2().getType().getSize() - 1;
16041604
for (const auto &idxAttr : getIndices().getAsRange<cir::IntAttr>()) {
1605-
if (idxAttr.getUInt() > maxValidIndex)
1605+
if (idxAttr.getSInt() != -1 && idxAttr.getUInt() > maxValidIndex)
16061606
return emitOpError() << ": index for __builtin_shufflevector must be "
16071607
"less than the total number of vector elements";
16081608
}

0 commit comments

Comments
 (0)