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
08a47b92
Commit
08a47b92
authored
4 years ago
by
Hashim Sharif
Browse files
Options
Downloads
Patches
Plain Diff
Adding support for removing @llvm.visc.node.id calls in ClearDFG (conseravtive for correctness)
parent
059a6fb7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llvm/lib/Transforms/ClearDFG/ClearDFG.cpp
+20
-3
20 additions, 3 deletions
llvm/lib/Transforms/ClearDFG/ClearDFG.cpp
with
20 additions
and
3 deletions
llvm/lib/Transforms/ClearDFG/ClearDFG.cpp
+
20
−
3
View file @
08a47b92
...
...
@@ -59,6 +59,7 @@ private:
//Functions
void
deleteNode
(
DFNode
*
N
);
public:
// Constructor
TreeTraversal
(
Module
&
_M
,
BuildDFG
&
_DFG
)
:
M
(
_M
),
DFG
(
_DFG
)
{
}
...
...
@@ -88,6 +89,7 @@ public:
};
bool
ClearDFG
::
runOnModule
(
Module
&
M
)
{
errs
()
<<
"
\n
CLEARDFG PASS
\n
"
;
// Get the BuildDFG Analysis Results:
// - Dataflow graph
...
...
@@ -118,6 +120,19 @@ bool ClearDFG::runOnModule(Module &M) {
VC
->
replaceAllUsesWith
(
UndefValue
::
get
(
VC
->
getType
()));
VC
->
eraseFromParent
();
Function
*
VN
=
M
.
getFunction
(
"llvm.visc.node.id"
);
if
(
VN
!=
NULL
){
// Delete visc.node.id intrinsic calls if they exist
for
(
Value
::
user_iterator
ui
=
VN
->
user_begin
(),
ue
=
VN
->
user_end
();
ui
!=
ue
;
ui
++
)
{
Instruction
*
I
=
dyn_cast
<
Instruction
>
(
*
ui
);
I
->
eraseFromParent
();
}
VN
->
replaceAllUsesWith
(
UndefValue
::
get
(
VN
->
getType
()));
VN
->
eraseFromParent
();
}
// Visitor for Code Generation Graph Traversal
TreeTraversal
*
Visitor
=
new
TreeTraversal
(
M
,
DFG
);
...
...
@@ -125,7 +140,9 @@ bool ClearDFG::runOnModule(Module &M) {
for
(
auto
rootNode
:
Roots
)
{
Visitor
->
visit
(
rootNode
);
}
delete
Visitor
;
return
true
;
}
...
...
@@ -149,7 +166,7 @@ void TreeTraversal::deleteNode(DFNode* N) {
char
ClearDFG
::
ID
=
0
;
static
RegisterPass
<
ClearDFG
>
X
(
"clearDFG"
,
"Delete all DFG functions for which code has been generated"
,
false
/* does not modify the CFG */
,
true
/* transformation, not just analysis */
);
"Delete all DFG functions for which code has been generated"
,
false
/* does not modify the CFG */
,
true
/* transformation, not just analysis */
);
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