LLVM
4.0.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
llvm.src
include
llvm
Transforms
Scalar
Float2Int.h
Go to the documentation of this file.
1
//===-- Float2Int.h - Demote floating point ops to work on integers -------===//
2
//
3
// The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
//
10
// This file provides the Float2Int pass, which aims to demote floating
11
// point operations to work on integers, where that is losslessly possible.
12
//
13
//===----------------------------------------------------------------------===//
14
15
#ifndef LLVM_TRANSFORMS_SCALAR_FLOAT2INT_H
16
#define LLVM_TRANSFORMS_SCALAR_FLOAT2INT_H
17
18
#include "
llvm/ADT/EquivalenceClasses.h
"
19
#include "
llvm/ADT/MapVector.h
"
20
#include "
llvm/IR/ConstantRange.h
"
21
#include "
llvm/IR/Function.h
"
22
#include "
llvm/IR/PassManager.h
"
23
24
namespace
llvm {
25
class
Float2IntPass
:
public
PassInfoMixin
<Float2IntPass> {
26
public
:
27
PreservedAnalyses
run
(
Function
&
F
,
FunctionAnalysisManager
&AM);
28
29
// Glue for old PM.
30
bool
runImpl
(
Function
&F);
31
32
private
:
33
void
findRoots(
Function
&F,
SmallPtrSet<Instruction *, 8>
&Roots);
34
ConstantRange
seen(
Instruction
*
I
,
ConstantRange
R);
35
ConstantRange
badRange();
36
ConstantRange
unknownRange();
37
ConstantRange
validateRange(
ConstantRange
R);
38
void
walkBackwards(
const
SmallPtrSetImpl<Instruction *>
&Roots);
39
void
walkForwards();
40
bool
validateAndTransform();
41
Value
*convert(
Instruction
*I,
Type
*ToTy);
42
void
cleanup();
43
44
MapVector<Instruction *, ConstantRange>
SeenInsts;
45
SmallPtrSet<Instruction *, 8>
Roots;
46
EquivalenceClasses<Instruction *>
ECs;
47
MapVector<Instruction *, Value *>
ConvertedInsts;
48
LLVMContext
*Ctx;
49
};
50
}
51
#endif // LLVM_TRANSFORMS_SCALAR_FLOAT2INT_H
MapVector.h
llvm::MapVector
This class implements a map that also provides access to all stored values in a deterministic order...
Definition:
MapVector.h:32
llvm::Function
Definition:
Function.h:48
llvm::Float2IntPass::runImpl
bool runImpl(Function &F)
Definition:
Float2Int.cpp:492
llvm::Float2IntPass
Definition:
Float2Int.h:25
llvm::SmallPtrSetImpl
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
Definition:
SmallPtrSet.h:345
EquivalenceClasses.h
llvm::Instruction
Definition:
Instruction.h:39
F
#define F(x, y, z)
Definition:
MD5.cpp:51
llvm::PassInfoMixin
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition:
PassManager.h:311
llvm::PreservedAnalyses
A set of analyses that are preserved following a run of a transformation pass.
Definition:
PassManager.h:107
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed...
Definition:
Type.h:45
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition:
LLVMContext.h:48
llvm::EquivalenceClasses
EquivalenceClasses - This represents a collection of equivalence classes and supports three efficient...
Definition:
EquivalenceClasses.h:59
ConstantRange.h
llvm::SmallPtrSet< Instruction *, 8 >
llvm::Float2IntPass::run
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Definition:
Float2Int.cpp:516
llvm::ConstantRange
This class represents a range of values.
Definition:
ConstantRange.h:45
Function.h
I
#define I(x, y, z)
Definition:
MD5.cpp:54
llvm::Value
LLVM Value Representation.
Definition:
Value.h:71
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition:
IRPrintingPasses.h:33
PassManager.h
This header defines various interfaces for pass management in LLVM.
Generated on Wed Mar 8 2017 17:08:43 for LLVM by
1.8.6