Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
llvm-epi
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
Show more breadcrumbs
Roger Ferrer
llvm-epi
Commits
9ae28b14
Commit
9ae28b14
authored
14 years ago
by
Chris Lattner
Browse files
Options
Downloads
Patches
Plain Diff
fix PR6743, a case where we'd delete an instruction before using it
in some cases. llvm-svn: 100937
parent
b9801ffc
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/lib/Transforms/Scalar/JumpThreading.cpp
+3
-1
3 additions, 1 deletion
llvm/lib/Transforms/Scalar/JumpThreading.cpp
llvm/test/Transforms/JumpThreading/crash.ll
+17
-0
17 additions, 0 deletions
llvm/test/Transforms/JumpThreading/crash.ll
with
20 additions
and
1 deletion
llvm/lib/Transforms/Scalar/JumpThreading.cpp
+
3
−
1
View file @
9ae28b14
...
@@ -670,8 +670,10 @@ bool JumpThreading::ProcessBranchOnDuplicateCond(BasicBlock *PredBB,
...
@@ -670,8 +670,10 @@ bool JumpThreading::ProcessBranchOnDuplicateCond(BasicBlock *PredBB,
Value
*
OldCond
=
DestBI
->
getCondition
();
Value
*
OldCond
=
DestBI
->
getCondition
();
DestBI
->
setCondition
(
ConstantInt
::
get
(
Type
::
getInt1Ty
(
BB
->
getContext
()),
DestBI
->
setCondition
(
ConstantInt
::
get
(
Type
::
getInt1Ty
(
BB
->
getContext
()),
BranchDir
));
BranchDir
));
ConstantFoldTerminator
(
BB
);
// Delete dead instructions before we fold the branch. Folding the branch
// can eliminate edges from the CFG which can end up deleting OldCond.
RecursivelyDeleteTriviallyDeadInstructions
(
OldCond
);
RecursivelyDeleteTriviallyDeadInstructions
(
OldCond
);
ConstantFoldTerminator
(
BB
);
return
true
;
return
true
;
}
}
...
...
This diff is collapsed.
Click to expand it.
llvm/test/Transforms/JumpThreading/crash.ll
+
17
−
0
View file @
9ae28b14
...
@@ -324,3 +324,20 @@ A: ; preds = %entry
...
@@ -324,3 +324,20 @@ A: ; preds = %entry
call
void
undef
(
i64
ptrtoint
(
i8
*
blockaddress
(
@test11
,
%A
)
to
i64
))
nounwind
call
void
undef
(
i64
ptrtoint
(
i8
*
blockaddress
(
@test11
,
%A
)
to
i64
))
nounwind
unreachable
unreachable
}
}
; PR6743
define
void
@test12
()
nounwind
ssp
{
entry:
br
label
%lbl_51
lbl_51:
; preds = %if.then, %entry
%tmp3
=
phi
i1
[
false
,
%if.then
],
[
undef
,
%entry
]
; <i1> [#uses=2]
br
i1
%tmp3
,
label
%if.end12
,
label
%if.then
if.then:
; preds = %lbl_51
br
i1
%tmp3
,
label
%lbl_51
,
label
%if.end12
if.end12:
; preds = %if.then, %lbl_51
ret
void
}
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