This is an archive of the discontinued LLVM Phabricator instance.

mlir: Avoid SmallVector::set_size in SerializeToHsacoPass::loadLibraries
ClosedPublic

Authored by dexonsmith on Jan 11 2022, 6:22 PM.

Details

Summary

Spotted this in a final grep of projects I don't usually build before
pushing https://reviews.llvm.org/D115380, which makes
SmallVector::set_size() private.

Update to truncate(), a new-ish variant of resize() that asserts the
new size is not bigger and that avoids pulling in the allocation and
initialization code for growing. Doesn't really look like the perf
impact of that would matter here, but since dirLength is known to be a
smaller size then we might as well.

Blocker for https://reviews.llvm.org/D115380.

Diff Detail

Event Timeline

dexonsmith created this revision.Jan 11 2022, 6:22 PM
dexonsmith requested review of this revision.Jan 11 2022, 6:22 PM
mehdi_amini accepted this revision.Jan 11 2022, 9:06 PM
This revision is now accepted and ready to land.Jan 11 2022, 9:06 PM
krzysz00 accepted this revision.Jan 12 2022, 7:49 AM

LGTM as well!