Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
llvm-epi-0.8
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Roger Ferrer
llvm-epi-0.8
Commits
16993845
Commit
16993845
authored
18 years ago
by
Devang Patel
Browse files
Options
Downloads
Patches
Plain Diff
LPPassManager. Implement preparePassManager() hook.
llvm-svn: 34975
parent
9d9fc909
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
llvm/include/llvm/Analysis/LoopPass.h
+9
-1
9 additions, 1 deletion
llvm/include/llvm/Analysis/LoopPass.h
llvm/lib/Analysis/LoopPass.cpp
+25
-0
25 additions, 0 deletions
llvm/lib/Analysis/LoopPass.cpp
with
34 additions
and
1 deletion
llvm/include/llvm/Analysis/LoopPass.h
+
9
−
1
View file @
16993845
...
...
@@ -44,7 +44,15 @@ class LoopPass : public Pass {
// Finalization hook does not supply Loop because at this time
// loop nest is completely different.
virtual
bool
doFinalization
()
{
return
false
;
}
// Check if this pass is suitable for the current LPPassManager, if
// available. This pass P is not suitable for a LPPassManager if P
// is not preserving higher level analysis info used by other
// LPPassManager passes. In such case, pop LPPassManager from the
// stack. This will force assignPassManager() to create new
// LPPassManger as expected.
void
preparePassManager
(
PMStack
&
PMS
);
/// Assign pass manager to manager this pass
virtual
void
assignPassManager
(
PMStack
&
PMS
,
PassManagerType
PMT
=
PMT_LoopPassManager
);
...
...
This diff is collapsed.
Click to expand it.
llvm/lib/Analysis/LoopPass.cpp
+
25
−
0
View file @
16993845
...
...
@@ -129,6 +129,31 @@ bool LPPassManager::runOnFunction(Function &F) {
//===----------------------------------------------------------------------===//
// LoopPass
// Check if this pass is suitable for the current LPPassManager, if
// available. This pass P is not suitable for a LPPassManager if P
// is not preserving higher level analysis info used by other
// LPPassManager passes. In such case, pop LPPassManager from the
// stack. This will force assignPassManager() to create new
// LPPassManger as expected.
void
LoopPass
::
preparePassManager
(
PMStack
&
PMS
)
{
// Find LPPassManager
while
(
!
PMS
.
empty
())
{
if
(
PMS
.
top
()
->
getPassManagerType
()
>
PMT_LoopPassManager
)
PMS
.
pop
();
else
;
break
;
}
LPPassManager
*
LPPM
=
dynamic_cast
<
LPPassManager
*>
(
PMS
.
top
());
// If this pass is destroying high level information that is used
// by other passes that are managed by LPM then do not insert
// this pass in current LPM. Use new LPPassManager.
if
(
LPPM
&&
!
LPPM
->
preserveHigherLevelAnalysis
(
this
))
PMS
.
pop
();
}
/// Assign pass manager to manage this pass.
void
LoopPass
::
assignPassManager
(
PMStack
&
PMS
,
PassManagerType
PreferredType
)
{
...
...
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