summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm-annotate.h
blob: 25454ed6330e780c8e40d56cfb1ca1c4c7e6a1fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 *  (C) 2015 by Computer System Laboratory, IIS, Academia Sinica, Taiwan.
 *      See COPYRIGHT in top-level directory.
 */

#ifndef __LLVM_ANNOTATE_H
#define __LLVM_ANNOTATE_H

#include <map>
#include <cstdint>
#include "qemu-types.h"
#include "llvm-types.h"
#include "utils.h"

/* Loop metadata */
struct LoopMetadata {
    LoopMetadata()
        : Address(-1), Length(-1), VS(-1), VF(-1), Distance(INT_MIN), Start(-1),
          End(-1), Stride(-1) {}
    target_ulong Address;
    uint32_t Length;
    uint32_t VS, VF;
    int Distance;
    int Start, End;
    int Stride;
};

/*
 * The AnnotationFactory class manages the metadata information.
 */
class AnnotationFactory {
    typedef std::map<uintptr_t, LoopMetadata*> LoopList;

    std::string MetaFile;

    int ParseXML(const char *name);

public:
    AnnotationFactory();
    ~AnnotationFactory();

    LoopList Loops;
    LoopMetadata *getLoopAnnotation(target_ulong addr);
    bool hasLoopAnnotation(target_ulong addr);
};

#endif

/*
 * vim: ts=8 sts=4 sw=4 expandtab
 */
OpenPOWER on IntegriCloud