Skip to content

Commit b42fd22

Browse files
committed
inlineGroupLocalMemoryFunc: return false -> continue
1 parent a4f8382 commit b42fd22

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

llvm/lib/SYCLLowerIR/LowerWGLocalMemory.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,18 @@ static bool inlineGroupLocalMemoryFunc(Module &M) {
9696
if (!ALMFunc || ALMFunc->use_empty())
9797
return false;
9898

99+
bool Changed = false;
99100
for (auto *U : ALMFunc->users()) {
100101
auto *Caller = cast<CallInst>(U)->getFunction();
101102
if (!Caller->hasFnAttribute(Attribute::AlwaysInline)) {
102103
// Already inlined.
103-
return false;
104+
continue;
104105
}
105106
std::string FName = llvm::demangle(Caller->getName());
106107
if (FName.find("sycl::_V1::ext::oneapi::group_local_memory") ==
107108
std::string::npos) {
108109
// Already inlined.
109-
return false;
110+
continue;
110111
}
111112
for (auto *U2 : make_early_inc_range(Caller->users())) {
112113
auto *CI = cast<CallInst>(U2);
@@ -115,9 +116,10 @@ static bool inlineGroupLocalMemoryFunc(Module &M) {
115116
assert(Result.isSuccess() && "inlining failed");
116117
}
117118
Caller->eraseFromParent();
119+
Changed = true;
118120
}
119121

120-
return true;
122+
return Changed;
121123
}
122124

123125
// TODO: It should be checked that __sycl_allocateLocalMemory (or its source

0 commit comments

Comments
 (0)