Skip to content

Commit 8286b80

Browse files
authored
OMPIRBuilder: Do not try to expand uses of ConstantData (#134584)
1 parent 87afe4d commit 8286b80

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7097,6 +7097,9 @@ static Expected<Function *> createOutlinedFunction(
70977097
continue;
70987098
}
70997099

7100+
if (isa<ConstantData>(Input))
7101+
continue;
7102+
71007103
ReplaceValue(Input, InputCopy, Func);
71017104
}
71027105

llvm/lib/IR/ReplaceConstant.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ bool convertUsersOfConstantsToInstructions(ArrayRef<Constant *> Consts,
5656
// Find all expandable direct users of Consts.
5757
SmallVector<Constant *> Stack;
5858
for (Constant *C : Consts) {
59+
assert(!isa<ConstantData>(C) &&
60+
"should not be expanding trivial constant users");
61+
5962
if (IncludeSelf) {
6063
assert(isExpandableUser(C) && "One of the constants is not expandable");
6164
Stack.push_back(C);

0 commit comments

Comments
 (0)