Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hpvm-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
llvm
hpvm-release
Commits
3bc5f65d
Commit
3bc5f65d
authored
6 years ago
by
kotsifa2
Browse files
Options
Downloads
Patches
Plain Diff
Promise backend works with expected promise simulator call signatures
parent
fc45b99d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llvm/lib/Transforms/DFG2LLVM_PROMISE/DFG2LLVM_PROMISE.cpp
+16
-4
16 additions, 4 deletions
llvm/lib/Transforms/DFG2LLVM_PROMISE/DFG2LLVM_PROMISE.cpp
with
16 additions
and
4 deletions
llvm/lib/Transforms/DFG2LLVM_PROMISE/DFG2LLVM_PROMISE.cpp
+
16
−
4
View file @
3bc5f65d
...
...
@@ -118,6 +118,7 @@ class InitialState : public AbstractState {
public:
InitialState
()
{
StateID
=
ID
::
INITIAL_STATE
;
DEBUG
(
errs
()
<<
"new InitialState
\n
"
);
}
~
InitialState
()
{}
...
...
@@ -128,6 +129,7 @@ class FullyConnectedLayer_1 : public AbstractState {
public:
FullyConnectedLayer_1
()
{
StateID
=
ID
::
FULLY_CONNECTED_LAYER_1
;
DEBUG
(
errs
()
<<
"new FullyConnectedLayer_1
\n
"
);
}
~
FullyConnectedLayer_1
()
{}
...
...
@@ -138,6 +140,7 @@ class FullyConnectedLayer_2 : public AbstractState {
public:
FullyConnectedLayer_2
()
{
StateID
=
ID
::
FULLY_CONNECTED_LAYER_2
;
DEBUG
(
errs
()
<<
"new FullyConnectedLayer_2
\n
"
);
}
~
FullyConnectedLayer_2
()
{}
...
...
@@ -148,6 +151,7 @@ class FullyConnectedLayer_3 : public AbstractState {
public:
FullyConnectedLayer_3
()
{
StateID
=
ID
::
FULLY_CONNECTED_LAYER_3
;
DEBUG
(
errs
()
<<
"new FullyConnectedLayer_3
\n
"
);
}
~
FullyConnectedLayer_3
()
{}
...
...
@@ -158,6 +162,7 @@ class FullyConnectedLayer : public AbstractState {
public:
FullyConnectedLayer
()
{
StateID
=
ID
::
FULLY_CONNECTED_LAYER
;
DEBUG
(
errs
()
<<
"new FullyConnectedLayer
\n
"
);
}
~
FullyConnectedLayer
()
{}
...
...
@@ -168,6 +173,7 @@ class ConvolutionLayer_1 : public AbstractState {
public:
ConvolutionLayer_1
()
{
StateID
=
ID
::
CONVOLUTION_LAYER_1
;
DEBUG
(
errs
()
<<
"new ConvolutionLayer_1
\n
"
);
}
~
ConvolutionLayer_1
()
{}
...
...
@@ -178,6 +184,7 @@ class ConvolutionLayer_2 : public AbstractState {
public:
ConvolutionLayer_2
()
{
StateID
=
ID
::
CONVOLUTION_LAYER_2
;
DEBUG
(
errs
()
<<
"new ConvolutionLayer_2
\n
"
);
}
~
ConvolutionLayer_2
()
{}
...
...
@@ -188,6 +195,7 @@ class ConvolutionLayer_3 : public AbstractState {
public:
ConvolutionLayer_3
()
{
StateID
=
ID
::
CONVOLUTION_LAYER_3
;
DEBUG
(
errs
()
<<
"new ConvolutionLayer_3
\n
"
);
}
~
ConvolutionLayer_3
()
{}
...
...
@@ -198,6 +206,7 @@ class ConvolutionLayer_4 : public AbstractState {
public:
ConvolutionLayer_4
()
{
StateID
=
ID
::
CONVOLUTION_LAYER_4
;
DEBUG
(
errs
()
<<
"new ConvolutionLayer_4
\n
"
);
}
~
ConvolutionLayer_4
()
{}
...
...
@@ -208,6 +217,7 @@ class ConvolutionLayer : public AbstractState {
public:
ConvolutionLayer
()
{
StateID
=
ID
::
CONVOLUTION_LAYER
;
DEBUG
(
errs
()
<<
"new ConvolutionLayer
\n
"
);
}
~
ConvolutionLayer
()
{}
...
...
@@ -218,6 +228,7 @@ class NoPattern : public AbstractState {
public:
NoPattern
()
{
StateID
=
ID
::
NO_PATTERN
;
DEBUG
(
errs
()
<<
"new NoPattern
\n
"
);
}
~
NoPattern
()
{}
...
...
@@ -545,8 +556,8 @@ void CodeGenStateMachine::codeGen() {
RtM
->
getFunction
(
StringRef
(
"convolution"
))
->
getFunctionType
());
DEBUG
(
errs
()
<<
*
convolution
);
// FIXME: get last argument from some intrinsic
?
Args
.
push_back
(
ConstantInt
::
get
(
Type
::
getInt32Ty
(
M
->
getContext
()),
1
));
// FIXME: get last argument from some intrinsic
. For now, 0
Args
.
push_back
(
ConstantInt
::
get
(
Type
::
getInt32Ty
(
M
->
getContext
()),
0
));
// Create PROMISE simulator function call
CI
=
CallInst
::
Create
(
convolution
,
Args
,
""
);
}
...
...
@@ -558,11 +569,12 @@ void CodeGenStateMachine::codeGen() {
RtM
->
getFunction
(
StringRef
(
"fullyConnected"
))
->
getFunctionType
());
DEBUG
(
errs
()
<<
*
fullyConnected
);
// FIXME: get last argument from some intrinsic
?
Args
.
push_back
(
ConstantInt
::
get
(
Type
::
getInt32Ty
(
M
->
getContext
()),
1
));
// FIXME: get last argument from some intrinsic
. For now, 0
Args
.
push_back
(
ConstantInt
::
get
(
Type
::
getInt32Ty
(
M
->
getContext
()),
0
));
// Create PROMISE simulator function call
CI
=
CallInst
::
Create
(
fullyConnected
,
Args
,
""
);
}
break
;
default
:
llvm_unreachable
(
"Unexpected CodeGenStateMachine State
\n
"
);
break
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment