This is an archive of the discontinued LLVM Phabricator instance.

OpenMP: Avoid using SmallVector::set_size()
ClosedPublic

Authored by dexonsmith on Dec 8 2021, 12:35 PM.

Details

Summary

Update OpenMPIRBuilder::collapseLoops() to call resize() instead of
set_size(). The latter asserts on capacity limits and cannot grow,
which seems likely to be unintentional here (if it is, I think a local
assertion would be good for clarity).

Also update CodeGenFunction::EmitOMPCollapsedCanonicalLoopNest() to
use pop_back_n() instead of set_size().

Diff Detail

Event Timeline

dexonsmith created this revision.Dec 8 2021, 12:35 PM
dexonsmith requested review of this revision.Dec 8 2021, 12:35 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
Herald added a subscriber: sstefan1. · View Herald Transcript
This revision is now accepted and ready to land.Dec 8 2021, 1:53 PM
This revision was landed with ongoing or failed builds.Dec 8 2021, 3:24 PM
This revision was automatically updated to reflect the committed changes.