Skip to content

Commit 197e0f5

Browse files
committed
Adopt review suggestion.
1 parent 7897636 commit 197e0f5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

llvm/lib/Target/SPIRV/SPIRVPrepareFunctions.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -588,10 +588,12 @@ bool SPIRVPrepareFunctions::removeAggregateTypesFromCalls(Function *F) {
588588
SmallVector<std::pair<int, Type *>> ChangedTypes;
589589
SmallVector<Type *> NewArgTypes;
590590

591-
if (CB->getType()->isAggregateType())
592-
ChangedTypes.emplace_back(-1, CB->getType());
591+
Type* RetTy = CB->getType();
592+
if (RetTy->isAggregateType()) {
593+
ChangedTypes.emplace_back(-1, RetTy);
594+
RetTy = B.getInt32Ty();
595+
}
593596

594-
Type *RetTy = ChangedTypes.empty() ? CB->getType() : B.getInt32Ty();
595597
for (auto &&Arg : CB->args()) {
596598
if (Arg->getType()->isAggregateType()) {
597599
NewArgTypes.push_back(B.getInt32Ty());

0 commit comments

Comments
 (0)