Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break Critical Edges pass doesn't update dominators right in some cases #1304

Closed
lattner opened this issue Oct 3, 2006 · 2 comments
Closed
Assignees
Labels
bugzilla Issues migrated from bugzilla code-quality

Comments

@lattner
Copy link
Collaborator

lattner commented Oct 3, 2006

Bugzilla Link 932
Resolution FIXED
Resolved on Feb 22, 2010 12:48
Version 1.8
OS All

Extended Description

Nick Lewycky reported that dominators we're getting updated for this .ll file correctly:

declare void %use1(int)

void %f(int %i, bool %c) {
entry:
%A = seteq int %i, 0
br bool %A, label %brtrue, label %brfalse

brtrue:
%B = phi bool [ true, %brtrue ], [ false, %entry ]
call void %use1(int %i)
br bool %B, label %brtrue, label %brfalse

brfalse:
call void %use1(int %i)
ret void
}

Correct is:

Inorder Dominator Tree:
[1] %entry
[2] %entry.brfalse_crit_edge
[2] %entry.brtrue_crit_edge
[3] %brtrue
[4] %brtrue.brfalse_crit_edge
[4] %brtrue.brtrue_crit_edge
[2] %brfalse

Computed is:

Inorder Dominator Tree:
[1] %entry
[2] %brtrue
[3] %brtrue.brtrue_crit_edge
[3] %brtrue.brfalse_crit_edge
[2] %brfalse
[2] %entry.brtrue_crit_edge
[2] %entry.brfalse_crit_edge

BCE assumes that the broken edge block can never dominate anything, which is incorrect in this case.

-Chris

@lattner
Copy link
Collaborator Author

lattner commented Oct 3, 2006

assigned to @lattner

@lattner
Copy link
Collaborator Author

lattner commented Oct 3, 2006

Fixed. Testcase here: Analysis/Dominators/2006-10-02-BreakCritEdges.ll

Patch/analysis here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20061002/038237.html

-Chris

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla code-quality
Projects
None yet
Development

No branches or pull requests

1 participant