6 Commits

Author SHA1 Message Date
Mircea Trofin
6329355860
[ctxprof] Move test serialization to yaml (#122545)
We have a textual representation of contextual profiles for test scenarios, mainly. This patch moves that to YAML instead of JSON. YAML is more succinct and readable (some of the .ll tests should be illustrative). In addition, JSON is parse-able by the YAML reader.

A subsequent patch will address deserialization.

(thanks, @kazutakahirata, for showing me how to use the llvm YAML reader/writer APIs, which I incorrectly thought to be more low-level than the JSON ones!)
2025-01-10 18:04:25 -08:00
Mircea Trofin
37f42cfb9a
[nfc] Update header in llvm-ctxprof-utils (#122544) 2025-01-10 15:43:10 -08:00
Zibi Sarbinowski
0de1e3e787
[;SystemZ][z/OS] Fix llvm-ctxprof to open input files in text mode (#109691)
Reading text files on z/OS relies on auto conversion to handle
ASCII/EBCDIC correctly. For this to work files need to be opened in text
mode is that is the type of the file. This PR fixes `llvm-ctxprof`
utility in this regards which in turn fixes the following LIT failure on
z/OS:

`FAIL: LLVM :: Analysis/CtxProfAnalysis/flatten-zero-path.ll`
2024-09-24 09:43:02 -04:00
Mircea Trofin
1022323c9b
[ctx_prof] Move the "from json" logic more centrally to reuse it from test. (#106129)
Making the synthesis of a contextual profile file from a JSON descriptor more reusable, for unittest authoring purposes.

The functionality round-trips through the binary format - no reason, currently, to support other ways of loading contextual profiles.
2024-08-27 15:43:05 -07:00
Mircea Trofin
7f3dcf4b2e
[ctx_prof] Don't use GENERATE_DRIVER (#100777) 2024-07-26 15:59:43 -04:00
Mircea Trofin
a737b8704c
[ctx_prof] test tool: generate ctxprof bistream from json (#100379)
This is a tool to simplify testing. It generates a valid contextual profile file from a json representation.

The tool is authored to allow for future evolution, e.g. if we want to support profile merging or other tasks, not necessarily scoped to testing.
2024-07-25 15:52:49 -04:00