This is an archive of the discontinued LLVM Phabricator instance.

[llvm-reduce] Move code to check chunk to function, to enable reuse (NFC).
ClosedPublic

Authored by fhahn on Nov 14 2021, 11:16 AM.

Details

Summary

This patch moves the logic to clone and check a new chunk into a new
function, to allow re-use in a follow-up patch that implements parallel
reductions.

Diff Detail

Event Timeline

fhahn requested review of this revision.Nov 14 2021, 11:16 AM
fhahn created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptNov 14 2021, 11:16 AM
dblaikie accepted this revision.Nov 14 2021, 11:23 AM

Might even be worth pulling out as a named function - given how long the outer function is.

llvm/tools/llvm-reduce/deltas/Delta.cpp
219–220

Usually I'd suggest any lambda that doesn't escape its scope should default capture by ref [&] rather than enumerating the captures (since it's like any other local scope - like a loop, etc - and should have access to all local variables without needing to declare them) - but given the intended direction involves parallelism, I'm with you here that it's good to enumerate the captures to avoid using some shared state accidentally that isn't thread safe.

This revision is now accepted and ready to land.Nov 14 2021, 11:23 AM
fhahn updated this revision to Diff 387581.Nov 16 2021, 5:16 AM

Move code to separate function instead of lambda, as suggested.

fhahn updated this revision to Diff 387583.Nov 16 2021, 5:17 AM

remove stray whitespace change

fhahn retitled this revision from [llvm-reduce] Move code to check chunk to lambda, to enable reuse (NFC). to [llvm-reduce] Move code to check chunk to function, to enable reuse (NFC)..Nov 16 2021, 5:31 AM
fhahn edited the summary of this revision. (Show Details)
This revision was landed with ongoing or failed builds.Nov 16 2021, 7:40 AM
This revision was automatically updated to reflect the committed changes.