clang-fix

This commit is contained in:
georgemoralis 2024-12-19 10:25:03 +02:00
parent 188eebb92a
commit b0b74243af
2 changed files with 10 additions and 8 deletions

View file

@ -327,7 +327,8 @@ void PS4_SYSV_ABI sched_yield() {
std::this_thread::yield(); std::this_thread::yield();
} }
int PS4_SYSV_ABI posix_pthread_once(PthreadOnce* once_control, void PS4_SYSV_ABI (*init_routine)()) { int PS4_SYSV_ABI posix_pthread_once(PthreadOnce* once_control,
void PS4_SYSV_ABI (*init_routine)()) {
for (;;) { for (;;) {
auto state = once_control->state.load(); auto state = once_control->state.load();
if (state == PthreadOnceState::Done) { if (state == PthreadOnceState::Done) {

View file

@ -27,13 +27,14 @@ void SharedMemoryBarrierPass(IR::Program& program, const Profile& profile) {
continue; continue;
} }
const IR::U1 cond = node.data.if_node.cond; const IR::U1 cond = node.data.if_node.cond;
const auto insert_barrier = IR::BreadthFirstSearch(cond, [](IR::Inst* inst) -> std::optional<bool> { const auto insert_barrier =
if (inst->GetOpcode() == IR::Opcode::GetAttributeU32 && IR::BreadthFirstSearch(cond, [](IR::Inst* inst) -> std::optional<bool> {
inst->Arg(0).Attribute() == IR::Attribute::LocalInvocationId) { if (inst->GetOpcode() == IR::Opcode::GetAttributeU32 &&
return true; inst->Arg(0).Attribute() == IR::Attribute::LocalInvocationId) {
} return true;
return std::nullopt; }
}); return std::nullopt;
});
if (insert_barrier) { if (insert_barrier) {
IR::Block* const merge = node.data.if_node.merge; IR::Block* const merge = node.data.if_node.merge;
auto insert_point = std::ranges::find_if_not(merge->Instructions(), IR::IsPhi); auto insert_point = std::ranges::find_if_not(merge->Instructions(), IR::IsPhi);