OMPIRBuilder: Do not try to expand uses of ConstantData

This commit is contained in:
Matt Arsenault 2025-04-07 12:57:44 +07:00 committed by Matt Arsenault
parent f5f3638e52
commit 62484208ba
2 changed files with 6 additions and 0 deletions

View File

@ -7032,6 +7032,9 @@ static Expected<Function *> createOutlinedFunction(
continue;
}
if (isa<ConstantData>(Input))
continue;
ReplaceValue(Input, InputCopy, Func);
}

View File

@ -56,6 +56,9 @@ bool convertUsersOfConstantsToInstructions(ArrayRef<Constant *> Consts,
// Find all expandable direct users of Consts.
SmallVector<Constant *> Stack;
for (Constant *C : Consts) {
assert(!isa<ConstantData>(C) &&
"should not be expanding trivial constant users");
if (IncludeSelf) {
assert(isExpandableUser(C) && "One of the constants is not expandable");
Stack.push_back(C);