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
bf67b122
Commit
bf67b122
authored
18 years ago
by
Chris Lattner
Browse files
Options
Downloads
Patches
Plain Diff
Switch InsertedPHINodes back to SmallPtrSet now that the SmallPtrSet::erase
bug is fixed. llvm-svn: 33932
parent
92c5d118
No related branches found
Branches containing commit
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/Utils/PromoteMemoryToRegister.cpp
+6
-6
6 additions, 6 deletions
llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
with
6 additions
and
6 deletions
llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
+
6
−
6
View file @
bf67b122
...
@@ -115,7 +115,7 @@ namespace {
...
@@ -115,7 +115,7 @@ namespace {
private
:
private
:
void
MarkDominatingPHILive
(
BasicBlock
*
BB
,
unsigned
AllocaNum
,
void
MarkDominatingPHILive
(
BasicBlock
*
BB
,
unsigned
AllocaNum
,
std
::
s
et
<
PHINode
*>
&
DeadPHINodes
);
SmallPtrS
et
<
PHINode
*
,
16
>
&
DeadPHINodes
);
bool
PromoteLocallyUsedAlloca
(
BasicBlock
*
BB
,
AllocaInst
*
AI
);
bool
PromoteLocallyUsedAlloca
(
BasicBlock
*
BB
,
AllocaInst
*
AI
);
void
PromoteLocallyUsedAllocas
(
BasicBlock
*
BB
,
void
PromoteLocallyUsedAllocas
(
BasicBlock
*
BB
,
const
std
::
vector
<
AllocaInst
*>
&
AIs
);
const
std
::
vector
<
AllocaInst
*>
&
AIs
);
...
@@ -123,7 +123,7 @@ namespace {
...
@@ -123,7 +123,7 @@ namespace {
void
RenamePass
(
BasicBlock
*
BB
,
BasicBlock
*
Pred
,
void
RenamePass
(
BasicBlock
*
BB
,
BasicBlock
*
Pred
,
std
::
vector
<
Value
*>
&
IncVals
);
std
::
vector
<
Value
*>
&
IncVals
);
bool
QueuePhiNode
(
BasicBlock
*
BB
,
unsigned
AllocaIdx
,
unsigned
&
Version
,
bool
QueuePhiNode
(
BasicBlock
*
BB
,
unsigned
AllocaIdx
,
unsigned
&
Version
,
std
::
s
et
<
PHINode
*>
&
InsertedPHINodes
);
SmallPtrS
et
<
PHINode
*
,
16
>
&
InsertedPHINodes
);
};
};
}
// end of anonymous namespace
}
// end of anonymous namespace
...
@@ -271,7 +271,7 @@ void PromoteMem2Reg::run() {
...
@@ -271,7 +271,7 @@ void PromoteMem2Reg::run() {
// dominance frontier of EACH basic-block we have a write in.
// dominance frontier of EACH basic-block we have a write in.
//
//
unsigned
CurrentVersion
=
0
;
unsigned
CurrentVersion
=
0
;
std
::
s
et
<
PHINode
*>
InsertedPHINodes
;
SmallPtrS
et
<
PHINode
*
,
16
>
InsertedPHINodes
;
std
::
vector
<
unsigned
>
DFBlocks
;
std
::
vector
<
unsigned
>
DFBlocks
;
while
(
!
DefiningBlocks
.
empty
())
{
while
(
!
DefiningBlocks
.
empty
())
{
BasicBlock
*
BB
=
DefiningBlocks
.
back
();
BasicBlock
*
BB
=
DefiningBlocks
.
back
();
...
@@ -315,7 +315,7 @@ void PromoteMem2Reg::run() {
...
@@ -315,7 +315,7 @@ void PromoteMem2Reg::run() {
UsingBlocks
.
clear
();
UsingBlocks
.
clear
();
// If there are any PHI nodes which are now known to be dead, remove them!
// If there are any PHI nodes which are now known to be dead, remove them!
for
(
std
::
s
et
<
PHINode
*>::
iterator
I
=
InsertedPHINodes
.
begin
(),
for
(
SmallPtrS
et
<
PHINode
*
,
16
>::
iterator
I
=
InsertedPHINodes
.
begin
(),
E
=
InsertedPHINodes
.
end
();
I
!=
E
;
++
I
)
{
E
=
InsertedPHINodes
.
end
();
I
!=
E
;
++
I
)
{
PHINode
*
PN
=
*
I
;
PHINode
*
PN
=
*
I
;
std
::
vector
<
PHINode
*>
&
BBPNs
=
NewPhiNodes
[
PN
->
getParent
()];
std
::
vector
<
PHINode
*>
&
BBPNs
=
NewPhiNodes
[
PN
->
getParent
()];
...
@@ -489,7 +489,7 @@ void PromoteMem2Reg::run() {
...
@@ -489,7 +489,7 @@ void PromoteMem2Reg::run() {
// DeadPHINodes set are removed.
// DeadPHINodes set are removed.
//
//
void
PromoteMem2Reg
::
MarkDominatingPHILive
(
BasicBlock
*
BB
,
unsigned
AllocaNum
,
void
PromoteMem2Reg
::
MarkDominatingPHILive
(
BasicBlock
*
BB
,
unsigned
AllocaNum
,
std
::
s
et
<
PHINode
*>
&
DeadPHINodes
)
{
SmallPtrS
et
<
PHINode
*
,
16
>
&
DeadPHINodes
)
{
// Scan the immediate dominators of this block looking for a block which has a
// Scan the immediate dominators of this block looking for a block which has a
// PHI node for Alloca num. If we find it, mark the PHI node as being alive!
// PHI node for Alloca num. If we find it, mark the PHI node as being alive!
for
(
DominatorTree
::
Node
*
N
=
DT
[
BB
];
N
;
N
=
N
->
getIDom
())
{
for
(
DominatorTree
::
Node
*
N
=
DT
[
BB
];
N
;
N
=
N
->
getIDom
())
{
...
@@ -630,7 +630,7 @@ PromoteLocallyUsedAllocas(BasicBlock *BB, const std::vector<AllocaInst*> &AIs) {
...
@@ -630,7 +630,7 @@ PromoteLocallyUsedAllocas(BasicBlock *BB, const std::vector<AllocaInst*> &AIs) {
//
//
bool
PromoteMem2Reg
::
QueuePhiNode
(
BasicBlock
*
BB
,
unsigned
AllocaNo
,
bool
PromoteMem2Reg
::
QueuePhiNode
(
BasicBlock
*
BB
,
unsigned
AllocaNo
,
unsigned
&
Version
,
unsigned
&
Version
,
std
::
s
et
<
PHINode
*>
&
InsertedPHINodes
)
{
SmallPtrS
et
<
PHINode
*
,
16
>
&
InsertedPHINodes
)
{
// Look up the basic-block in question.
// Look up the basic-block in question.
std
::
vector
<
PHINode
*>
&
BBPNs
=
NewPhiNodes
[
BB
];
std
::
vector
<
PHINode
*>
&
BBPNs
=
NewPhiNodes
[
BB
];
if
(
BBPNs
.
empty
())
BBPNs
.
resize
(
Allocas
.
size
());
if
(
BBPNs
.
empty
())
BBPNs
.
resize
(
Allocas
.
size
());
...
...
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