llir-opt
0.0.1
Low-Level Post-Link Optimiser for OCaml and C
passes
sccp
eval.h
1
// This file if part of the llir-opt project.
2
// Licensing information can be found in the LICENSE file.
3
// (C) 2018 Nandor Licker. All rights reserved.
4
5
#pragma once
6
7
#include "core/insts.h"
8
#include "passes/sccp/lattice.h"
9
10
11
15
class
SCCPEval
{
16
public
:
18
static
Lattice
Extend
(
const
Lattice
&arg, Type ty);
20
static
Lattice
Eval
(UnaryInst *inst,
Lattice
&arg);
22
static
Lattice
Eval
(BinaryInst *inst,
Lattice
&lhs,
Lattice
&rhs);
24
static
Lattice
Eval
(LoadInst *inst,
Lattice
&addr);
25
26
private
:
27
static
Lattice
Eval
(AbsInst *inst,
Lattice
&arg);
28
static
Lattice
Eval
(NegInst *inst,
Lattice
&arg);
29
static
Lattice
Eval
(SqrtInst *inst,
Lattice
&arg);
30
static
Lattice
Eval
(SinInst *inst,
Lattice
&arg);
31
static
Lattice
Eval
(CosInst *inst,
Lattice
&arg);
32
static
Lattice
Eval
(SExtInst *inst,
Lattice
&arg);
33
static
Lattice
Eval
(ZExtInst *inst,
Lattice
&arg);
34
static
Lattice
Eval
(XExtInst *inst,
Lattice
&arg);
35
static
Lattice
Eval
(FExtInst *inst,
Lattice
&arg);
36
static
Lattice
Eval
(TruncInst *inst,
Lattice
&arg);
37
static
Lattice
Eval
(ExpInst *inst,
Lattice
&arg);
38
static
Lattice
Eval
(Exp2Inst *inst,
Lattice
&arg);
39
static
Lattice
Eval
(LogInst *inst,
Lattice
&arg);
40
static
Lattice
Eval
(Log2Inst *inst,
Lattice
&arg);
41
static
Lattice
Eval
(Log10Inst *inst,
Lattice
&arg);
42
static
Lattice
Eval
(FCeilInst *inst,
Lattice
&arg);
43
static
Lattice
Eval
(FFloorInst *inst,
Lattice
&arg);
44
static
Lattice
Eval
(PopCountInst *inst,
Lattice
&arg);
45
static
Lattice
Eval
(CtzInst *inst,
Lattice
&arg);
46
static
Lattice
Eval
(ClzInst *inst,
Lattice
&arg);
47
static
Lattice
Eval
(ByteSwapInst *inst,
Lattice
&arg);
48
static
Lattice
Eval
(BitCastInst *inst,
Lattice
&arg);
49
50
static
Lattice
Eval
(AddInst *inst,
Lattice
&lhs,
Lattice
&rhs);
51
static
Lattice
Eval
(AndInst *inst,
Lattice
&lhs,
Lattice
&rhs);
52
static
Lattice
Eval
(UDivInst *inst,
Lattice
&lhs,
Lattice
&rhs);
53
static
Lattice
Eval
(SDivInst *inst,
Lattice
&lhs,
Lattice
&rhs);
54
static
Lattice
Eval
(URemInst *inst,
Lattice
&lhs,
Lattice
&rhs);
55
static
Lattice
Eval
(SRemInst *inst,
Lattice
&lhs,
Lattice
&rhs);
56
static
Lattice
Eval
(MulInst *inst,
Lattice
&lhs,
Lattice
&rhs);
57
static
Lattice
Eval
(MulHSInst *inst,
Lattice
&lhs,
Lattice
&rhs);
58
static
Lattice
Eval
(MulHUInst *inst,
Lattice
&lhs,
Lattice
&rhs);
59
static
Lattice
Eval
(OrInst *inst,
Lattice
&lhs,
Lattice
&rhs);
60
static
Lattice
Eval
(SubInst *inst,
Lattice
&lhs,
Lattice
&rhs);
61
static
Lattice
Eval
(XorInst *inst,
Lattice
&lhs,
Lattice
&rhs);
62
static
Lattice
Eval
(PowInst *inst,
Lattice
&lhs,
Lattice
&rhs);
63
static
Lattice
Eval
(CopySignInst *inst,
Lattice
&lhs,
Lattice
&rhs);
64
static
Lattice
Eval
(OUAddInst *inst,
Lattice
&lhs,
Lattice
&rhs);
65
static
Lattice
Eval
(OUMulInst *inst,
Lattice
&lhs,
Lattice
&rhs);
66
static
Lattice
Eval
(OUSubInst *inst,
Lattice
&lhs,
Lattice
&rhs);
67
static
Lattice
Eval
(OSAddInst *inst,
Lattice
&lhs,
Lattice
&rhs);
68
static
Lattice
Eval
(OSMulInst *inst,
Lattice
&lhs,
Lattice
&rhs);
69
static
Lattice
Eval
(OSSubInst *inst,
Lattice
&lhs,
Lattice
&rhs);
70
72
enum class
Bitwise {
73
SRL,
74
SRA,
75
SLL,
76
ROTL,
77
ROTR
78
};
79
81
static
Lattice
Eval
(Bitwise kind, Type ty,
Lattice
&lhs,
Lattice
&rhs);
82
};
Lattice
Definition:
lattice.h:22
SCCPEval
Definition:
eval.h:15
SCCPEval::Eval
static Lattice Eval(UnaryInst *inst, Lattice &arg)
Evaluates a unary instruction.
Definition:
eval.cpp:284
SCCPEval::Extend
static Lattice Extend(const Lattice &arg, Type ty)
Performs type conversions, if necessary.
Definition:
eval.cpp:48
Generated by
1.8.17