Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
00d3cf11
Commit
00d3cf11
authored
Mar 25, 2018
by
HungMingWu
Committed by
Tianqi Chen
Mar 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LLVM 7.0 support (#1048)
parent
4b72f293
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
src/codegen/llvm/llvm_module.cc
+12
-0
No files found.
src/codegen/llvm/llvm_module.cc
View file @
00d3cf11
...
...
@@ -68,7 +68,11 @@ class LLVMModuleNode final : public runtime::ModuleNode {
CHECK_EQ
(
ecode
.
value
(),
0
)
<<
"Cannot open file: "
<<
file_name
<<
" "
<<
ecode
.
message
();
if
(
fmt
==
"o"
||
fmt
==
"obj"
)
{
#if TVM_LLVM_VERSION <= 60
std
::
unique_ptr
<
llvm
::
Module
>
m
=
llvm
::
CloneModule
(
mptr_
);
#else
std
::
unique_ptr
<
llvm
::
Module
>
m
=
llvm
::
CloneModule
(
*
mptr_
);
#endif
llvm
::
legacy
::
PassManager
pass
;
CHECK
(
tm_
);
CHECK
(
tm_
->
addPassesToEmitFile
(
...
...
@@ -76,7 +80,11 @@ class LLVMModuleNode final : public runtime::ModuleNode {
<<
"Cannot emit target CGFT_ObjectFile"
;
pass
.
run
(
*
m
);
}
else
if
(
fmt
==
"s"
||
fmt
==
"asm"
)
{
#if TVM_LLVM_VERSION <= 60
std
::
unique_ptr
<
llvm
::
Module
>
m
=
llvm
::
CloneModule
(
mptr_
);
#else
std
::
unique_ptr
<
llvm
::
Module
>
m
=
llvm
::
CloneModule
(
*
mptr_
);
#endif
llvm
::
legacy
::
PassManager
pass
;
CHECK
(
tm_
);
CHECK
(
tm_
->
addPassesToEmitFile
(
...
...
@@ -86,7 +94,11 @@ class LLVMModuleNode final : public runtime::ModuleNode {
}
else
if
(
fmt
==
"ll"
)
{
mptr_
->
print
(
dest
,
nullptr
);
}
else
if
(
fmt
==
"bc"
)
{
#if TVM_LLVM_VERSION <= 60
llvm
::
WriteBitcodeToFile
(
mptr_
,
dest
);
#else
llvm
::
WriteBitcodeToFile
(
*
mptr_
,
dest
);
#endif
}
else
{
LOG
(
FATAL
)
<<
"Do not know how to save file "
<<
file_name
<<
" with format=
\'
"
<<
format
<<
"
\'
"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment