[PATCH] D150816: [llvm-mca][RISCV] Fix llvm-mca RISCVInstrument memory leak

Michael Maitland via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 14:37:45 PDT 2023


michaelmaitland added a comment.

Valgrind reports `1711 errors from 1711 contexts` before my fix and `1710 errors from 1710 contexts` after my fix. It looks like using valgrind has problems related to python code. This is the command I ran:

  valgrind --leak-check=yes bin/llvm-lit -v ../llvm/test/tools/llvm-mca/RISCV/different-instruments.s ../llvm/test/tools/llvm-mca/RISCV/disable-im.s ../llvm/test/tools/llvm-mca/RISCV/instrument-at-start.s ../llvm/test/tools/llvm-mca/RISCV/instrument-in-middle.s ../llvm/test/tools/llvm-mca/RISCV/instrument-in-region.s ../llvm/test/tools/llvm-mca/RISCV/instrument-straddles-region.s ../llvm/test/tools/llvm-mca/RISCV/multiple-same-instruments.s ../llvm/test/tools/llvm-mca/RISCV/riscv-instrument-no-data-is-err.s ../llvm/test/tools/llvm-mca/RISCV/unknown-instrument-is-err.s ../llvm/test/tools/llvm-mca/RISCV/unknown-lmul-is-err.s

I also see these kinds of errors when I run `valgrind --leak-check=yes bin/llvm-lit ../llvm/test/tools/llvm-mca/X86/*` with and without my memory leak fix, although these test cases do not cause LSan to complain upstream.

I re-ran without the `leack-check=yes` option on RISCV tests with my fix, RISCV tests without my fix and on x86 before the original instrument changes were made and all three have many instances of `definitely lost: n bytes in m blocks`. I'm not sure how helpful valgrind is here as it looks like it may struggle with the python driver of llvm-lit.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150816/new/

https://reviews.llvm.org/D150816



More information about the llvm-commits mailing list