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
576db371
Commit
576db371
authored
19 years ago
by
Chris Lattner
Browse files
Options
Downloads
Patches
Plain Diff
add routines to track the livein/out set for a function
llvm-svn: 21179
parent
46aa06cf
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/include/llvm/CodeGen/MachineFunction.h
+21
-0
21 additions, 0 deletions
llvm/include/llvm/CodeGen/MachineFunction.h
with
21 additions
and
0 deletions
llvm/include/llvm/CodeGen/MachineFunction.h
+
21
−
0
View file @
576db371
...
...
@@ -105,6 +105,11 @@ class MachineFunction : private Annotation {
/// for other target specific uses.
bool
*
UsedPhysRegs
;
/// LiveIns/LiveOuts - Keep track of the physical registers that are
/// livein/liveout of the function. Live in values are typically arguments in
/// registers, live out values are typically return values in registers.
std
::
vector
<
unsigned
>
LiveIns
,
LiveOuts
;
public:
MachineFunction
(
const
Function
*
Fn
,
const
TargetMachine
&
TM
);
~
MachineFunction
();
...
...
@@ -167,6 +172,22 @@ public:
/// allocation to keep the PhysRegsUsed array up-to-date.
void
changePhyRegUsed
(
unsigned
Reg
,
bool
State
)
{
UsedPhysRegs
[
Reg
]
=
State
;
}
// LiveIn/LiveOut management methods.
/// addLiveIn/Out - Add the specified register as a live in/out. Note that it
/// is an error to add the same register to the same set more than once.
void
addLiveIn
(
unsigned
Reg
)
{
LiveIns
.
push_back
(
Reg
);
}
void
addLiveOut
(
unsigned
Reg
)
{
LiveOuts
.
push_back
(
Reg
);
}
// Iteration support for live in/out sets. These sets are kept in sorted
// order by their register number.
typedef
std
::
vector
<
unsigned
>::
const_iterator
liveinout_iterator
;
liveinout_iterator
livein_begin
()
const
{
return
LiveIns
.
begin
();
}
liveinout_iterator
livein_end
()
const
{
return
LiveIns
.
end
();
}
liveinout_iterator
liveout_begin
()
const
{
return
LiveOuts
.
begin
();
}
liveinout_iterator
liveout_end
()
const
{
return
LiveOuts
.
end
();
}
/// getBlockNumbered - MachineBasicBlocks are automatically numbered when they
/// are inserted into the machine function. The block number for a machine
/// basic block can be found by using the MBB::getBlockNumber method, this
...
...
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