forked from Hoernchen/Epiphany
-
Notifications
You must be signed in to change notification settings - Fork 2
/
EpiphanyFpuConfigPass.h
63 lines (51 loc) · 1.97 KB
/
EpiphanyFpuConfigPass.h
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
52
53
54
55
56
57
58
59
60
61
62
63
//===---------------------EpiphanyFpuConfigPass.h--------------------------===//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef _LLVM_LIB_TARGET_EPIPHANY_EPIPHANYFPUCONFIGPASS_H
#define _LLVM_LIB_TARGET_EPIPHANY_EPIPHANYFPUCONFIGPASS_H
#include "Epiphany.h"
#include "EpiphanyConfig.h"
#include "EpiphanyMachineFunction.h"
#include "EpiphanySubtarget.h"
#include "EpiphanyTargetMachine.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegisterInfo.h"
namespace llvm {
void initializeEpiphanyFpuConfigPassPass(PassRegistry&);
class EpiphanyFpuConfigPass : public MachineFunctionPass {
private:
const EpiphanyInstrInfo *TII;
unsigned originalFrameIdx;
unsigned fpuFrameIdx;
unsigned ialuFrameIdx;
enum PredState {
PRED_START, PRED_FPU, PRED_IALU, PRED_MIXED
};
public:
static char ID;
EpiphanyFpuConfigPass() : MachineFunctionPass(ID) {
initializeEpiphanyFpuConfigPassPass(*PassRegistry::getPassRegistry());
}
StringRef getPassName() const {
return "Epiphany FPU/IALU2 config flag optimization pass";
}
void insertConfigInst(MachineBasicBlock *MBB, MachineBasicBlock::iterator insertPos,
MachineRegisterInfo &MRI, const EpiphanySubtarget &ST, unsigned frameIdx);
bool runOnMachineFunction(MachineFunction &MF);
};
} // namespace llvm
#endif