[all-commits] [llvm/llvm-project] 4e04a5: [TableGen] Avoid a couple vector copies in ExpandH...

Craig Topper via All-commits all-commits at lists.llvm.org
Sat Jan 30 13:27:23 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4e04a535d8f836804d39e8861ae17d7817293c5a
      https://github.com/llvm/llvm-project/commit/4e04a535d8f836804d39e8861ae17d7817293c5a
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2021-01-30 (Sat, 30 Jan 2021)

  Changed paths:
    M llvm/utils/TableGen/CodeGenDAGPatterns.cpp

  Log Message:
  -----------
  [TableGen] Avoid a couple vector copies in ExpandHwModeBasedTypes.

Use vector::swap instead of copying to a local vector and clearing
the original. We can just swap into the just created local vector
instead which will move the pointers and not the data.

Use std::move in another place to avoid a copy.


  Commit: b5e3a5785dab0d0c7aa68cc65c2dd348488e72d1
      https://github.com/llvm/llvm-project/commit/b5e3a5785dab0d0c7aa68cc65c2dd348488e72d1
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2021-01-30 (Sat, 30 Jan 2021)

  Changed paths:
    M llvm/utils/TableGen/CodeGenDAGPatterns.cpp

  Log Message:
  -----------
  [TableGen] Use emplace_back to add to PatternsToMatch in GenerateVariants. Use std::move when adding to PatternsToMatch in AddPatternToMatch.

We already used emplace_back in at least one other place so be
consistent.

AddPatternToMatch already took PTM as an rvalue reference, but
we need to use std::move again to move it into the PatternToMatch
vector.


Compare: https://github.com/llvm/llvm-project/compare/26d38f6d20ff...b5e3a5785dab


More information about the All-commits mailing list