[all-commits] [llvm/llvm-project] ec37eb: [NFC] Use SmallVector/ArrayRef in MachineOutliner/...

Jessica Paquette via All-commits all-commits at lists.llvm.org
Fri Feb 3 16:42:01 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ec37ebf59be78665caa679d46607a2f054155c55
      https://github.com/llvm/llvm-project/commit/ec37ebf59be78665caa679d46607a2f054155c55
  Author: Jessica Paquette <jpaquette at apple.com>
  Date:   2023-02-03 (Fri, 03 Feb 2023)

  Changed paths:
    M llvm/include/llvm/Support/SuffixTree.h
    M llvm/lib/CodeGen/MachineOutliner.cpp
    M llvm/lib/Support/SuffixTree.cpp

  Log Message:
  -----------
  [NFC] Use SmallVector/ArrayRef in MachineOutliner/SuffixTree for small types

The MachineOutliner + SuffixTree both used `std::vector` everywhere because I
didn't know any better at the time.

At least for small types, such as `unsigned` and iterators, I can't see any
particular reason to use std::vector over `SmallVector` here.


  Commit: 7bb9d70bbb984b78f48e82ff0fb862abd45bf6ee
      https://github.com/llvm/llvm-project/commit/7bb9d70bbb984b78f48e82ff0fb862abd45bf6ee
  Author: Jessica Paquette <jpaquette at apple.com>
  Date:   2023-02-03 (Fri, 03 Feb 2023)

  Changed paths:
    M llvm/include/llvm/Support/SuffixTree.h
    M llvm/lib/CodeGen/MachineOutliner.cpp

  Log Message:
  -----------
  [NFC] Remove unneccessary `llvm::` in MachineOutliner/SuffixTree

We have `using llvm`, we don't need to say `llvm::`.


  Commit: 443c5b9fd505f5fe2df92ee27bf1d4d9e0dc4cb9
      https://github.com/llvm/llvm-project/commit/443c5b9fd505f5fe2df92ee27bf1d4d9e0dc4cb9
  Author: Jessica Paquette <jpaquette at apple.com>
  Date:   2023-02-03 (Fri, 03 Feb 2023)

  Changed paths:
    M llvm/lib/CodeGen/MachineOutliner.cpp

  Log Message:
  -----------
  [NFC] Remove redundant check for MBB being empty in outliner

If the size is < 2, then we just break anyway.


  Commit: fe35e142dffa4f67b0d377bb37d0fdc26aa057dd
      https://github.com/llvm/llvm-project/commit/fe35e142dffa4f67b0d377bb37d0fdc26aa057dd
  Author: Jessica Paquette <jpaquette at apple.com>
  Date:   2023-02-03 (Fri, 03 Feb 2023)

  Changed paths:
    M llvm/lib/CodeGen/MachineOutliner.cpp

  Log Message:
  -----------
  [MachineOutliner] NFC: Pull variable out from erase_if

`Mapper.UnsignedVec.begin()` never changes throughout the call to
`erase_if`, so no need to recalculate it.

Also drop some redundant braces.


Compare: https://github.com/llvm/llvm-project/compare/a772f0bb920a...fe35e142dffa


More information about the All-commits mailing list