Spatial
Simple Static Analysis in LLVM
PTABenchmark.h
Go to the documentation of this file.
1#ifndef PTA_BENCHMARK_H
2#define PTA_BENCHMARK_H
3
4#include "Benchmark.h"
5#include "set"
6#include "string"
7#include "llvm/IR/Argument.h"
8#include "llvm/IR/Function.h"
9#include "llvm/IR/Instructions.h"
10#include "llvm/IR/Type.h"
11#include "llvm/IR/Value.h"
12
13namespace spatial {
14
16private:
17 std::map<llvm::Instruction *, std::string> Result;
18 void evaluateUtil(llvm::CallInst *, int, int, int);
19
20public:
22 std::vector<llvm::Value *> extract(llvm::Instruction *Inst);
23 friend std::ostream &operator<<(std::ostream &OS,
24 const PTABenchmarkRunner &B);
25 template <class Ty>
26 void evaluate(llvm::Instruction *Inst, std::set<Ty *>, std::set<Ty *>);
27};
28
29template <class Ty>
30void PTABenchmarkRunner::evaluate(llvm::Instruction *I, std::set<Ty *> A,
31 std::set<Ty *> B) {
32 llvm::CallInst *Inst = llvm::cast<llvm::CallInst>(I);
33 std::set<Ty> Result;
34 for (auto a : A)
35 Result.insert(*a);
36 for (auto b : B)
37 Result.insert(*b);
38 evaluateUtil(Inst, A.size(), B.size(), Result.size());
39}
40} // namespace spatial
41
42#endif
Definition: Benchmark.h:14
Definition: PTABenchmark.h:15
friend std::ostream & operator<<(std::ostream &OS, const PTABenchmarkRunner &B)
Definition: PTABenchmark.cpp:14
PTABenchmarkRunner()
Definition: PTABenchmark.h:21
std::vector< llvm::Value * > extract(llvm::Instruction *Inst)
Definition: PTABenchmark.cpp:45
void evaluate(llvm::Instruction *Inst, std::set< Ty * >, std::set< Ty * >)
Definition: PTABenchmark.h:30
Definition: PointsToBenchmark.cpp:19