Guard against a potential crash observed in https://github.com/JuliaLang/julia/issues/32994#issuecomment-524249628
If two branches are collapsed we can encounter a degenerate conditional branch TBB==FBB.
The subsequent code assumes that they differ, so we exit out early.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/CodeGenPrepare.cpp | ||
---|---|---|
7349–7351 | Formatting is off, and how does that work in a debug build? No braces for the 'if'. Might be better to just leave out the LLVM_DEBUG line. | |
llvm/test/CodeGen/X86/codegen-prepare-collapse.ll | ||
2 | Is there some way to create a test with 'opt -codegenprepare -S' rather than 'llc'? That would be preferable since the bug is not x86-specific. |
Sorry that it took so long for me to finish this.
llvm/test/CodeGen/X86/codegen-prepare-collapse.ll | ||
---|---|---|
2 | I haven't been able to reproduce the crash with opt, if I recall correctly it needs a fully instantiated TargetMachine to trigger the crash |
Unit tests: fail. 57754 tests passed, 1 failed and 719 were skipped.
failed: Clang.Driver/check-time-trace-sections.cpp
clang-format: pass.
Build artifacts: console-log.txt, CMakeCache.txt, test-results.xml, diff.json
Nit: Add period at end of comment sentence.