[all-commits] [llvm/llvm-project] 9ab133: [nfc][InstrProfTest]Parameterize the edge cases of...

Mingming Liu via All-commits all-commits at lists.llvm.org
Wed Nov 22 21:22:34 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9ab133bd9f9cedb880b453dd830b58857fab41ec
      https://github.com/llvm/llvm-project/commit/9ab133bd9f9cedb880b453dd830b58857fab41ec
  Author: Mingming Liu <mingmingl at google.com>
  Date:   2023-11-22 (Wed, 22 Nov 2023)

  Changed paths:
    M llvm/unittests/ProfileData/InstrProfTest.cpp

  Log Message:
  -----------
  [nfc][InstrProfTest]Parameterize the edge cases of value profile merge by value kind (#73165)

There are three test cases to test the merge of value profiles. 'get_icall_data_merge1' tests the basic case;
{get_icall_data_merge1_saturation, get_icall_data_merge_site_trunc} tests the edge case.

This patch parameterizes the edge case test coverage by value kind and adds the coverage of 'IPVK_MemOPSize'. Keep the basic test structure as it is. The main reason is test data construction and test assertions is
clearer for each kind in the basic test.
- Using a loop for different value kinds in one test case doesn't work
very well. The instr-prof-writer is stateful (e.g., keeps track of
per-function profile data in a
[container](https://github.com/llvm/llvm-project/blob/a9c149df7666bb2f8755794b97573134e5cfeb38/llvm/include/llvm/ProfileData/InstrProfWriter.h#L43))




More information about the All-commits mailing list