Open Quuxplusone opened 3 years ago
Investigated this bug and found out that there is a looping of the form:
1-st Iteration:
br i1 undef, label %zero.critedge, label %bci_89.us589.preheader.split ---> br
i1 undef, label %zero, label %bci_89.us589.preheader.split
zero.critedge: ---> remove
br label %zero
zero: ; preds = %zero.critedge, %bci_89.us ---> zero: ; preds =
%"static void FuzzerUtils.init(jobject, jfloat)541743.exit.split", %bci_89.us
2-nd Iteration:
bci_89.us: ; preds = %"static jobject
java.lang.invoke.Invokers$Holder.linkToTargetMethod(jobject)587833.exit" --->
bci_89.us: ; preds = %"static void FuzzerUtils.init(jobject,
jfloat)541743.exit.split", %"static jobject
java.lang.invoke.Invokers$Holder.linkToTargetMethod(jobject)587833.exit"
br i1 undef, label %zero, label %bci_89.us589.preheader.split ---> br i1
undef, label %bci_89.us, label %bci_89.us589.preheader.split
zero: ; preds = %"static void FuzzerUtils.init(jobject,
jfloat)541743.exit.split", %bci_89.us ---> zero: ; preds = %bci_89.us
3-d Iteration:
bci_89.us: ; preds = %"static void FuzzerUtils.init(jobject,
jfloat)541743.exit.split", %"static jobject
java.lang.invoke.Invokers$Holder.linkToTargetMethod(jobject)587833.exit" --->
bci_89.us: ; preds = %"static jobject
java.lang.invoke.Invokers$Holder.linkToTargetMethod(jobject)587833.exit"
br i1 undef, label %bci_89.us, label %bci_89.us589.preheader.split ---> br i1
undef, label %zero.critedge, label %bci_89.us589.preheader.split
create new BB ---> zero.critedge: ; preds =
%"static void FuzzerUtils.init(jobject, jfloat)541743.exit.split"
br label %zero
zero: ; preds = %bci_89.us ---> zero: ; preds = %zero.critedge,
%bci_89.us
Summary:
we removed one BB and after 1 iteration we created it.
Attached infoForBugGuard.txt
(8840 bytes, text/plain): More information from my researc
Dima, I am confused. What test are you referring?
I'm certain that FoldCondBranchOnPHI has nothing to do with this bug, at least because this test has no phis.
UPD: indeed, Phi appears there after it's created by
// Otherwise, if there are multiple predecessors, insert a PHI that merges
// in the constant and simplify the block result. Subsequent passes of
// simplifycfg will thread the block.
if (BlockIsSimpleEnoughToThreadThrough(BB)) {
Looks like this one and the following one "tryWidenCondBranchToCondBranch" keep
undoing one another.
This one should be the fix: https://reviews.llvm.org/D112693
infoForBugGuard.txt
(8840 bytes, text/plain)