Skip to content

Commit b4f32b4

Browse files
committed
[IRGen] Insts with packs in ops/results may alloc.
Instead of assuming that the list of instructions known to allocate pack metadata is exhaustive and returning false from mayRequirePackMetadata for all others, consider the types of the results and operands of other instructions and look for packs.
1 parent 9aaa5bb commit b4f32b4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/SIL/IR/SILInstruction.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,6 +1318,18 @@ bool SILInstruction::mayRequirePackMetadata() const {
13181318
return ty->hasPack();
13191319
}
13201320
default:
1321+
for (auto result : getResults()) {
1322+
if (result->getType().hasPack())
1323+
return true;
1324+
}
1325+
for (auto operandTy : getOperandTypes()) {
1326+
if (operandTy.hasPack())
1327+
return true;
1328+
}
1329+
for (auto &tdo : getTypeDependentOperands()) {
1330+
if (tdo.get()->getType().hasPack())
1331+
return true;
1332+
}
13211333
return false;
13221334
}
13231335
}

0 commit comments

Comments
 (0)