-
Notifications
You must be signed in to change notification settings - Fork 125
/
PeepholeOptimizationPass.h
39 lines (33 loc) · 1.47 KB
/
PeepholeOptimizationPass.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
//===-- PeepholeOptimizationPass.h ------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file contains the declaration of PeepholeOptimizationPass for use by
// llvm-mctoll. This class raises the abstraction of memory address computations
// raised from binary. These operations are often raised as a series of integer
// operations alongside ptrtoint/intoptr instructions, which we replace by
// getelementptr instructions and simple pointer casting.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TOOLS_LLVM_MCTOLL_PEEPHOLEOPTIMIZATIONPASS_H
#define LLVM_TOOLS_LLVM_MCTOLL_PEEPHOLEOPTIMIZATIONPASS_H
#include "llvm/Bitcode/BitcodeWriterPass.h"
#include "llvm/IR/IRPrintingPasses.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/PassManager.h"
#include "llvm/Pass.h"
#include "llvm/Support/CodeGen.h"
#include "llvm/Target/TargetMachine.h"
using namespace llvm;
class PeepholeOptimizationPass : public FunctionPass {
public:
static char ID;
PeepholeOptimizationPass() : FunctionPass(ID) {}
bool runOnFunction(Function &F) override;
void getAnalysisUsage(AnalysisUsage &AU) const override;
};
#endif // LLVM_TOOLS_LLVM_MCTOLL_PEEPHOLEOPTIMIZATIONPASS_H