-
Notifications
You must be signed in to change notification settings - Fork 15
failed assertion: Cannot split an edge from a CallBrInst #1161
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
Comments
ah, need to add the command line flags to repro, let me pare those down. |
$ clang -O2 migrate.i -ftrivial-auto-var-init=pattern --target=powerpc64le-linux-gnu Might be able to drop |
Yes, initializing |
Could you post the IR? |
Somehow, if I dump the IR, I can't reproduce by invoking |
Try invoking |
diff --git a/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp b/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
index 39fb504cf7b7..e88bdc8bf476 100644
--- a/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
+++ b/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
@@ -186,7 +186,8 @@ llvm::SplitCriticalEdge(Instruction *TI, unsigned SuccNum,
// Loop-simplify form can be preserved, if we can split all in-loop
// predecessors.
if (any_of(LoopPreds, [](BasicBlock *Pred) {
- return isa<IndirectBrInst>(Pred->getTerminator());
+ return isa<IndirectBrInst>(Pred->getTerminator()) ||
+ isa<CallBrInst>(Pred->getTerminator());
})) {
if (Options.PreserveLoopSimplify)
return nullptr; seems to fix this. Not sure yet about getting a work reproducer in IR, or what the consequences of that change precisely are. |
this issue is reminiscent of #896 |
Note to future self; use attaching minimal reproducer: $ clang -O2 --target=powerpc64le reduced.ll I haven't been able to figure out how to get it to crash by just invoking |
llc generates asm code. opt performs the IR transformations. I think you want to use opt and not llc. |
Ha, I thought I remember that #1252 looked familiar... I assume Bill's patch will fix this one too? |
oh, yeah, looks similar, cc @gwelymernans @MaskRay |
…rect successor Otherwise we'll fail the assertion in SplitBlockPredecessors() related to splitting the edges from CallBr's. Fixes: ClangBuiltLinux/linux#1161 Fixes: ClangBuiltLinux/linux#1252 Reviewed By: void, MaskRay, jyknight Differential Revision: https://reviews.llvm.org/D88438
…rect successor Otherwise we'll fail the assertion in SplitBlockPredecessors() related to splitting the edges from CallBr's. Fixes: ClangBuiltLinux/linux#1161 Fixes: ClangBuiltLinux/linux#1252 Reviewed By: void, MaskRay, jyknight Differential Revision: https://reviews.llvm.org/D88438
testing #1160 w/ assertions enabled, I hit an assertion failure; cvised down:
cc @gwelymernans @jyknight
The text was updated successfully, but these errors were encountered: