[all-commits] [llvm/llvm-project] 56674e: [llvm-mca][RISCV] Fix llvm-mca RISCVInstrument mem...

Michael Maitland via All-commits all-commits at lists.llvm.org
Mon May 22 10:37:02 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 56674e8e4a4bb086a03857ec28739b1ecbd05374
      https://github.com/llvm/llvm-project/commit/56674e8e4a4bb086a03857ec28739b1ecbd05374
  Author: Michael Maitland <michaeltmaitland at gmail.com>
  Date:   2023-05-22 (Mon, 22 May 2023)

  Changed paths:
    M llvm/include/llvm/MCA/CustomBehaviour.h
    M llvm/include/llvm/MCA/InstrBuilder.h
    M llvm/lib/MCA/CustomBehaviour.cpp
    M llvm/lib/MCA/InstrBuilder.cpp
    M llvm/lib/Target/RISCV/MCA/RISCVCustomBehaviour.cpp
    M llvm/lib/Target/RISCV/MCA/RISCVCustomBehaviour.h
    M llvm/tools/llvm-mca/CodeRegion.cpp
    M llvm/tools/llvm-mca/CodeRegion.h
    M llvm/tools/llvm-mca/CodeRegionGenerator.cpp
    M llvm/tools/llvm-mca/llvm-mca.cpp
    M llvm/unittests/tools/llvm-mca/MCATestBase.cpp
    M llvm/unittests/tools/llvm-mca/X86/TestIncrementalMCA.cpp

  Log Message:
  -----------
  [llvm-mca][RISCV] Fix llvm-mca RISCVInstrument memory leak

There was a memory leak that presented itself once the llvm-mca
tests were committed. This leak was not checked for by the pre-commit
tests. This change changes the shared_ptr to a unique_ptr to avoid
this problem.

We will know that this fix works once committed since I don't know
whether it is possible to force a lit test to use LSan. I spent the
day trying to build llvm with LSan enabled without much luck. If
anyone knows how to build llvm with LSan for the lit-tests, I am
happy to give it another try locally.

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


  Commit: 60d36ef096ce6563350a6ef6d7ea97f80d10564f
      https://github.com/llvm/llvm-project/commit/60d36ef096ce6563350a6ef6d7ea97f80d10564f
  Author: Michael Maitland <michaeltmaitland at gmail.com>
  Date:   2023-05-22 (Mon, 22 May 2023)

  Changed paths:
    A llvm/test/tools/llvm-mca/RISCV/different-instruments.s
    A llvm/test/tools/llvm-mca/RISCV/disable-im.s
    A llvm/test/tools/llvm-mca/RISCV/instrument-at-start.s
    A llvm/test/tools/llvm-mca/RISCV/instrument-in-middle.s
    A llvm/test/tools/llvm-mca/RISCV/instrument-in-region.s
    A llvm/test/tools/llvm-mca/RISCV/instrument-straddles-region.s
    A llvm/test/tools/llvm-mca/RISCV/lit.local.cfg
    A llvm/test/tools/llvm-mca/RISCV/multiple-same-instruments.s
    A llvm/test/tools/llvm-mca/RISCV/riscv-instrument-no-data-is-err.s
    A llvm/test/tools/llvm-mca/RISCV/unknown-instrument-is-err.s
    A llvm/test/tools/llvm-mca/RISCV/unknown-lmul-is-err.s

  Log Message:
  -----------
  [RISCV][llvm-mca] Add mca tests for riscv lmul instruments

Add llvm-mca tests for RISCV LMUL instruments to show that llvm-mca RISCV LMUL
instruments work.

This commit was previously reverted in 847789d45712. It is now being
recommitted since the memory leak has been fixed in 4d2a1d7dd8f4.

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


Compare: https://github.com/llvm/llvm-project/compare/9f992cc9350a...60d36ef096ce


More information about the All-commits mailing list