[all-commits] [llvm/llvm-project] b77d4d: mlir: Avoid SmallVector::set_size in SerializeToHs...

Duncan P. N. Exon Smith via All-commits all-commits at lists.llvm.org
Thu Jan 13 10:17:47 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b77d4d54f96a1110f1d83e19f773ac93537ca3f9
      https://github.com/llvm/llvm-project/commit/b77d4d54f96a1110f1d83e19f773ac93537ca3f9
  Author: Duncan P. N. Exon Smith <dexonsmith at apple.com>
  Date:   2022-01-13 (Thu, 13 Jan 2022)

  Changed paths:
    M mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp

  Log Message:
  -----------
  mlir: Avoid SmallVector::set_size in SerializeToHsacoPass::loadLibraries

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.

Differential Revision: https://reviews.llvm.org/D117073




More information about the All-commits mailing list