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
94e04442
Commit
94e04442
authored
18 years ago
by
Chris Lattner
Browse files
Options
Downloads
Patches
Plain Diff
implement support for inserting a cond branch
llvm-svn: 31096
parent
6fca75ec
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/Target/PowerPC/PPCInstrInfo.cpp
+8
-4
8 additions, 4 deletions
llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
with
8 additions
and
4 deletions
llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
+
8
−
4
View file @
94e04442
...
...
@@ -240,15 +240,19 @@ void PPCInstrInfo::InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
const
std
::
vector
<
MachineOperand
>
&
Cond
)
const
{
// Shouldn't be a fall through.
assert
(
TBB
&&
"InsertBranch must not be told to insert a fallthrough"
);
assert
((
Cond
.
size
()
==
2
||
Cond
.
size
()
==
0
)
&&
"PPC branch conditions have two components!"
);
//
Unconditional
branch
?
//
One-way
branch
.
if
(
FBB
==
0
)
{
BuildMI
(
&
MBB
,
PPC
::
B
,
1
).
addMBB
(
TBB
);
if
(
Cond
.
empty
())
// Unconditional branch
BuildMI
(
&
MBB
,
PPC
::
B
,
1
).
addMBB
(
TBB
);
else
// Conditional branch
BuildMI
(
&
MBB
,
PPC
::
COND_BRANCH
,
3
)
.
addReg
(
Cond
[
0
].
getReg
()).
addImm
(
Cond
[
1
].
getImm
()).
addMBB
(
TBB
);
return
;
}
assert
(
Cond
.
size
()
==
2
&&
"PPC branch conditions have two components!"
);
// Conditional branch
BuildMI
(
&
MBB
,
PPC
::
COND_BRANCH
,
3
)
.
addReg
(
Cond
[
0
].
getReg
()).
addImm
(
Cond
[
1
].
getImm
()).
addMBB
(
TBB
);
...
...
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