llvm / llvm/llvm-project

[LoopLoadElimination] Crash at -O2/3/s: unhandled irreducible control flow

Open
#191,585 1 comment 0 reactions 0 assignees View on GitHub
crash llvm:analysis
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Compiler Explorer: https://godbolt.org/z/1dTz533h1

small.ll

```llvm
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: optsize
define i32 @d(i32 %e) #0 {
entry:
br label %a

a: ; preds = %for.cond4, %entry
br label %for.cond

for.cond: ; preds = %for.cond1, %a
br label %for.cond1

for.cond1: ; preds = %for.inc, %for.cond
%0 = phi i8 [ 0, %for.cond ], [ %inc, %for.inc ]
%cmp = icmp slt i8 %0, 4
br i1 %cmp, label %for.body, label %for.cond

for.body: ; preds = %for.cond1
%conv3 = sext i8 %0 to i32
%and = and i32 %e, %conv3
%cond = icmp eq i32 %and, 0
br i1 %cond, label %for.cond4, label %sw.default

for.cond4: ; preds = %for.body
%tobool.not = icmp eq i32 %e, 0
br i1 %tobool.not, label %for.inc, label %a

sw.default: ; preds = %for.body
ret i32 0

for.inc: ; preds = %for.cond4
%inc = add i8 %0, 1
br label %for.cond1
}

; Function Attrs: optsize
define void @main(i8 %0, i32 %conv) #0 {
entry:
br label %for.cond

for.cond: ; preds = %for.body, %entry
%tobool.not = icmp eq i8 %0, 0
br i1 %tobool.not, label %for.end, label %for.body

for.body: ; preds = %for.cond
%call = call i32 @d(i32 %conv)
br label %for.cond

for.end: ; preds = %for.cond
ret void
}

attributes #0 = { optsize }

!llvm.module.flags = !{!0}

!0 = !{i32 1, !"ProfileSummary", !1}
!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10, !11}
!2 = !{!"ProfileFormat", !"InstrProf"}
!3 = !{!"TotalCount", i64 1}
!4 = !{!"MaxCount", i64 1}
!5 = !{!"MaxInternalCount", i64 0}
!6 = !{!"MaxFunctionCount", i64 1}
!7 = !{!"NumCounts", i64 10}
!8 = !{!"NumFunctions", i64 2}
!9 = !{!"IsPartialProfile", i64 0}
!10 = !{!"PartialProfileRatio", double 0.000000e+00}
!11 = !{!"DetailedSummary", !12}
!12 = !{!13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28}
!13 = !{i32 10000, i64 0, i32 0}
!14 = !{i32 100000, i64 0, i32 0}
!15 = !{i32 200000, i64 0, i32 0}
!16 = !{i32 300000, i64 0, i32 0}
!17 = !{i32 400000, i64 0, i32 0}
!18 = !{i32 500000, i64 0, i32 0}
!19 = !{i32 600000, i64 0, i32 0}
!20 = !{i32 700000, i64 0, i32 0}
!21 = !{i32 800000, i64 0, i32 0}
!22 = !{i32 900000, i64 0, i32 0}
!23 = !{i32 950000, i64 0, i32 0}
!24 = !{i32 990000, i64 0, i32 0}
!25 = !{i32 999000, i64 0, i32 0}
!26 = !{i32 999900, i64 0, i32 0}
!27 = !{i32 999990, i64 0, i32 0}
!28 = !{i32 999999, i64 0, i32 0}
```

Reproduce:
```
$ opt -O3 small.ll -o /dev/null
unhandled irreducible control flow
UNREACHABLE executed at /data/x27zhou/compiler-nightly/src/llvm-project/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h:1196!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: opt -O3 small.ll -o /dev/null
1. Running pass "function(drop-unnecessary-assumes,float2int,lower-constant-intrinsics,chr,loop(loop-rotate,loop-deletion),loop-distribute,inject-tli-mappings,loop-vectorize,drop-unnecessary-assumes,infer-alignment,loop-load-elim,instcombine,simplifycfg,slp-vectorizer,vector-combine,instcombine,loop-unroll,transform-warning,sroa,infer-alignment,instcombine,loop-mssa(licm),alignment-from-assumptions,loop-sink,instsimplify,div-rem-pairs,mergeicmps,expand-memcmp,tailcallelim,simplifycfg)" on module "small.ll"
2. Running pass "loop-load-elim" on function "main"
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 opt 0x0000560ee645d617 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 39
1 opt 0x0000560ee645b2ba llvm::sys::RunSignalHandlers() + 154
2 opt 0x0000560ee645e4b5
3 libc.so.6 0x00007f7878e11520
4 libc.so.6 0x00007f7878e659fc pthread_kill + 300
5 libc.so.6 0x00007f7878e11476 raise + 22
6 libc.so.6 0x00007f7878df77f3 abort + 211
7 opt 0x0000560ee63bc001
8 opt 0x0000560ee59e36d0 llvm::BlockFrequencyInfoImpl::calculate(llvm::Function const&, llvm::BranchProbabilityInfo const&, llvm::LoopInfo const&) + 656
9 opt 0x0000560ee59e302e llvm::BlockFrequencyInfo::calculate(llvm::Function const&, llvm::BranchProbabilityInfo const&, llvm::LoopInfo const&) + 190
10 opt 0x0000560ee59e51df llvm::BlockFrequencyAnalysis::run(llvm::Function&, llvm::AnalysisManager&) + 207
11 opt 0x0000560ee422043f
12 opt 0x0000560ee6242808 llvm::AnalysisManager::getResultImpl(llvm::AnalysisKey*, llvm::Function&) + 520
13 opt 0x0000560ee54fe49f llvm::LoopLoadEliminationPass::run(llvm::Function&, llvm::AnalysisManager&) + 639
14 opt 0x0000560ee424472d
15 opt 0x0000560ee6240197 llvm::PassManager>::run(llvm::Function&, llvm::AnalysisManager&) + 407
16 opt 0x0000560ee29eb2fd
17 opt 0x0000560ee6243cde llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager&) + 478
18 opt 0x0000560ee25199ed
19 opt 0x0000560ee623f277 llvm::PassManager>::run(llvm::Module&, llvm::AnalysisManager&) + 407
20 opt 0x0000560ee25115af llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef, llvm::ArrayRef>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool, bool) + 11455
21 opt 0x0000560ee2507478 optMain + 9832
22 libc.so.6 0x00007f7878df8d90
23 libc.so.6 0x00007f7878df8e40 __libc_start_main + 128
24 opt 0x0000560ee2504735 _start + 37
[1] 3734788 IOT instruction (core dumped) opt -O3 small.ll -o /dev/null
```

C reproducer:

small.c
```c
char c;
unsigned b;
unsigned d(unsigned e) {
a:
for (;;) {
c = 0;
for (; c <= 3; c++)
switch (c & e) {
case 0:
for (; b;)
goto a;
break;
default:
return e;
}
}
}
void main() {
for (; c;)
d(c);
}
```

Reproduce at -Os:
```
$ clang-trunk -O3 -fprofile-instr-generate small.c
$ LLVM_PROFILE_FILE="test.profraw" ./a.out
$ llvm-profdata merge -o test.profdata test.profraw
$ clang-trunk -Os -fprofile-instr-use=test.profdata small.c
```
Crash:
```
unhandled irreducible control flow
UNREACHABLE executed at /data/x27zhou/compiler-nightly/src/llvm-project/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h:1196!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /data/x27zhou/compiler-nightly/install/llvm/bin/clang-23 -cc1 -triple x86_64-unknown-linux-gnu -Os -emit-obj -dumpdir a- -disable-free -clear-ast-before-backend -main-file-name small.c -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/home/x27zhou/fuzz-pgo/PGOFuzz/pgofuzz2-output-2026-04-10-04-06-53/crash-clang-trunk-78805/perses_result -fprofile-instrument-use=clang -fprofile-instrument-use-path=test.profdata -fcoverage-compilation-dir=/home/x27zhou/fuzz-pgo/PGOFuzz/pgofuzz2-output-2026-04-10-04-06-53/crash-clang-trunk-78805/perses_result -resource-dir /data/x27zhou/compiler-nightly/install/llvm/lib/clang/23 -internal-isystem /data/x27zhou/compiler-nightly/install/llvm/lib/clang/23/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -ferror-limit 19 -fmessage-length=180 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -fdwarf2-cfi-asm -o /tmp/small-a1412c.o -x c small.c
1. parser at end of file
2. Optimizer
3. Running pass "function(drop-unnecessary-assumes,float2int,lower-constant-intrinsics,loop(loop-rotate,loop-deletion),loop-distribute,inject-tli-mappings,loop-vectorize,drop-unnecessary-assumes,infer-alignment,loop-load-elim,instcombine,simplifycfg,slp-vectorizer,vector-combine,instcombine,loop-unroll,transform-warning,sroa,infer-alignment,instcombine,loop-mssa(licm),alignment-from-assumptions,loop-sink,instsimplify,div-rem-pairs,mergeicmps,expand-memcmp,tailcallelim,simplifycfg)" on module "small.c"
4. Running pass "loop-load-elim" on function "main"
#0 0x00005601c2f15277 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /data/x27zhou/compiler-nightly/src/llvm-project/llvm/lib/Support/Unix/Signals.inc:880:13
#1 0x00005601c2f12f1a llvm::sys::RunSignalHandlers() /data/x27zhou/compiler-nightly/src/llvm-project/llvm/lib/Support/Signals.cpp:109:18
#2 0x00005601c2f16115 SignalHandler(int, siginfo_t*, void*) /data/x27zhou/compiler-nightly/src/llvm-project/llvm/lib/Support/Unix/Signals.inc:448:38
#3 0x00005601c2f15f78 int const* std::__find_if>(int const*, int const*, __gnu_cxx::__ops::_Iter_equals_val, std::random_access_iterator_tag) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_algobase.h:2067:8
#4 0x00005601c2f15f78 int const* std::__find_if>(int const*, int const*, __gnu_cxx::__ops::_Iter_equals_val) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_algobase.h:2112:14
#5 0x00005601c2f15f78 int const* std::find(int const*, int const*, int const&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_algo.h:3851:14
#6 0x00005601c2f15f78 bool llvm::is_contained(int const (&) [10], int const&) /data/x27zhou/compiler-nightly/src/llvm-project/llvm/include/llvm/ADT/STLExtras.h:1953:12
#7 0x00005601c2f15f78 SignalHandlerTerminate(int, siginfo_t*, void*) /data/x27zhou/compiler-nightly/src/llvm-project/llvm/lib/Support/Unix/Signals.inc:464:7
#8 0x00007f824a363520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#9 0x00007f824a3b79fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#10 0x00007f824a3b79fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#11 0x00007f824a3b79fc pthread_kill ./nptl/pthread_kill.c:89:10
#12 0x00007f824a363476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
#13 0x00007f824a3497f3 abort ./stdlib/abort.c:81:7
#14 0x00005601c2e84701 (/data/x27zhou/compiler-nightly/install/llvm/bin/clang-23+0x3a0f701)
#15 0x00005601c1fe9a70 llvm::BlockFrequencyInfoImpl::computeMassInFunction() /data/x27zhou/compiler-nightly/src/llvm-project/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h:1294:7
#16 0x00005601c1fe9a70 llvm::BlockFrequencyInfoImpl::calculate(llvm::Function const&, llvm::BranchProbabilityInfo const&, llvm::LoopInfo const&) /data/x27zhou/compiler-nightly/src/llvm-project/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h:1070:3
#17 0x00005601c1fe93ce llvm::BlockFrequencyInfo::calculate(llvm::Function const&, llvm::BranchProbabilityInfo const&, llvm::LoopInfo const&) /data/x27zhou/compiler-nightly/src/llvm-project/llvm/lib/Analysis/BlockFrequencyInfo.cpp:190:35
#18 0x00005601c1feb57f llvm::BlockFrequencyAnalysis::run(llvm::Function&, llvm::AnalysisManager&) /data/x27zhou/compiler-nightly/src/llvm-project/llvm/lib/Analysis/BlockFrequencyInfo.cpp:338:1
#19 0x00005601c3e79dcf std::__detail::_MakeUniq::Invalidator, true>>::__single_object std::make_unique::Invalidator, true>, llvm::BlockFrequencyInfo>(llvm::BlockFrequencyInfo&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:1065:30
#20 0x00005601c3e79dcf llvm::detail::AnalysisPassModel::Invalidator>::run(llvm::Function&, llvm::AnalysisManager&) /data/x27zhou/compiler-nightly/src/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:315:12
#21 0x00005601c2966768 std::__cxx11::list::Invalidator>, std::default_delete::Invalidator>>>>, std::allocator::Invalidator>, std::default_delete::Invalidator>>>>>>::end() /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_list.h:1043:25
#22 0x00005601c2966768 std::pair::Invalidator>, std::default_delete::Invalidator>>>>& std::__cxx11::list::Invalidator>, std::default_delete::Invalidator>>>>, std::allocator::Invalidator>, std::default_delete::Invalidator>>>>>>::emplace_back::Invalidator>, std::default_delete::Invalidator>>>>(llvm::AnalysisKey*&, std::unique_ptr::Invalidator>, std::default_delete::Invalidator>>>&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_list.h:1321:20
#23 0x00005601c2966768 llvm::AnalysisManager::getResultImpl(llvm::AnalysisKey*, llvm::Function&) /data/x27zhou/compiler-nightly/src/llvm-project/llvm/include/llvm/IR/PassManagerImpl.h:148:16
#24 0x00005601c64d583f llvm::BlockFrequencyAnalysis::Result& llvm::AnalysisManager::getResult(llvm::Function&) /data/x27zhou/compiler-nightly/src/llvm-project/llvm/include/llvm/IR/PassManager.h:421:55
#25 0x00005601c64d583f llvm::LoopLoadEliminationPass::run(llvm::Function&, llvm::AnalysisManager&) /data/x27zhou/compiler-nightly/src/llvm-project/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp:695:11
#26 0x00005601c3e968bd llvm::detail::PassModel>::run(llvm::Function&, llvm::AnalysisManager&) /data/x27zhou/compiler-nightly/src/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:91:5
#27 0x00005601c2963fd7 llvm::PassManager>::run(llvm::Function&, llvm::AnalysisManager&) /data/x27zhou/compiler-nightly/src/llvm-project/llvm/include/llvm/IR/PassManagerImpl.h:80:8
#28 0x00005601c07fac2d llvm::detail::PassModel>, llvm::AnalysisManager>::run(llvm::Function&, llvm::AnalysisManager&) /data/x27zhou/compiler-nightly/src/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:91:5
#29 0x00005601c2967c3e llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager&) /data/x27zhou/compiler-nightly/src/llvm-project/llvm/lib/IR/PassManager.cpp:132:23
#30 0x00005601c07fb8cd llvm::detail::PassModel>::run(llvm::Module&, llvm::AnalysisManager&) /data/x27zhou/compiler-nightly/src/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:91:5
#31 0x00005601c29630b7 llvm::PassManager>::run(llvm::Module&, llvm::AnalysisManager&) /data/x27zhou/compiler-nightly/src/llvm-project/llvm/include/llvm/IR/PassManagerImpl.h:80:8
#32 0x00005601c327000e llvm::SmallPtrSetImplBase::isSmall() const /data/x27zhou/compiler-nightly/src/llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h:248:33
#33 0x00005601c327000e llvm::SmallPtrSetImplBase::~SmallPtrSetImplBase() /data/x27zhou/compiler-nightly/src/llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h:89:10
#34 0x00005601c327000e llvm::PreservedAnalyses::~PreservedAnalyses() /data/x27zhou/compiler-nightly/src/llvm-project/llvm/include/llvm/IR/Analysis.h:112:7
#35 0x00005601c327000e (anonymous namespace)::EmitAssemblyHelper::RunOptimizationPipeline(clang::BackendAction, std::unique_ptr>&, std::unique_ptr>&, clang::BackendConsumer*) /data/x27zhou/compiler-nightly/src/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1209:5
#36 0x00005601c3267ae6 (anonymous namespace)::EmitAssemblyHelper::RunCodegenPipeline(clang::BackendAction, std::unique_ptr>&, std::unique_ptr>&) /data/x27zhou/compiler-nightly/src/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1218:7
#37 0x00005601c3267ae6 (anonymous namespace)::EmitAssemblyHelper::emitAssembly(clang::BackendAction, std::unique_ptr>, clang::BackendConsumer*) /data/x27zhou/compiler-nightly/src/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1301:3
#38 0x00005601c3267ae6 clang::emitBackendOutput(clang::CompilerInstance&, clang::CodeGenOptions&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr, std::unique_ptr>, clang::BackendConsumer*) /data/x27zhou/compiler-nightly/src/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1477:13
#39 0x00005601c37dbd03 std::unique_ptr>::~unique_ptr() /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:395:6
#40 0x00005601c37dbd03 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) /data/x27zhou/compiler-nightly/src/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:312:3
#41 0x00005601c4d49b87 __gnu_cxx::__normal_iterator>*, std::vector>, std::allocator>>>>::__normal_iterator(std::unique_ptr>* const&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_iterator.h:1073:20
#42 0x00005601c4d49b87 std::vector>, std::allocator>>>::begin() /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_vector.h:869:16
#43 0x00005601c4d49b87 void clang::finalize>, std::allocator>>>>(std::vector>, std::allocator>>>&, clang::Sema const&) /data/x27zhou/compiler-nightly/src/llvm-project/clang/include/clang/Sema/TemplateInstCallback.h:54:16
#44 0x00005601c4d49b87 clang::ParseAST(clang::Sema&, bool, bool) /data/x27zhou/compiler-nightly/src/llvm-project/clang/lib/Parse/ParseAST.cpp:190:3
#45 0x00005601c3a68856 clang::FrontendAction::Execute() /data/x27zhou/compiler-nightly/src/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1346:10
#46 0x00005601c39d690f llvm::Error::getPtr() const /data/x27zhou/compiler-nightly/src/llvm-project/llvm/include/llvm/Support/Error.h:278:42
#47 0x00005601c39d690f llvm::Error::operator bool() /data/x27zhou/compiler-nightly/src/llvm-project/llvm/include/llvm/Support/Error.h:241:16
#48 0x00005601c39d690f clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /data/x27zhou/compiler-nightly/src/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:990:23
#49 0x00005601c3b5fb05 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /data/x27zhou/compiler-nightly/src/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:318:25
#50 0x00005601c03eb018 cc1_main(llvm::ArrayRef, char const*, void*) /data/x27zhou/compiler-nightly/src/llvm-project/clang/tools/driver/cc1_main.cpp:302:15
#51 0x00005601c03e7500 ExecuteCC1Tool(llvm::SmallVectorImpl&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr) /data/x27zhou/compiler-nightly/src/llvm-project/clang/tools/driver/driver.cpp:229:12
#52 0x00005601c03e65fc clang_main(int, char**, llvm::ToolContext const&) /data/x27zhou/compiler-nightly/src/llvm-project/clang/tools/driver/driver.cpp:277:12
#53 0x00005601c03f64dd main /data/x27zhou/compiler-nightly/build/llvm/tools/clang/tools/driver/clang-driver.cpp:17:10
#54 0x00007f824a34ad90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#55 0x00007f824a34ae40 call_init ./csu/../csu/libc-start.c:128:20
#56 0x00007f824a34ae40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#57 0x00005601c03e4dc5 _start (/data/x27zhou/compiler-nightly/install/llvm/bin/clang-23+0xf6fdc5)
clang-trunk: error: unable to execute command: Aborted (core dumped)
clang-trunk: error: clang frontend command failed with exit code -2 (use -v to see invocation)
clang version 23.0.0git (https://github.com/llvm/llvm-project.git 9116344c02bf0b9ec037451d12935d7539c48679)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /data/x27zhou/compiler-nightly/install/llvm/bin
Build config: +assertions
clang-trunk: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-trunk: note: diagnostic msg: /tmp/small-346d77.c
clang-trunk: note: diagnostic msg: /tmp/small-346d77.sh
clang-trunk: note: diagnostic msg:

********************
[1] 3847809 IOT instruction (core dumped) clang-trunk -Os -fprofile-instr-use=test.profdata small.c
```
Label: generated by fuzzer

Contributor guide

Open the contributing guide

Research direction

Start by running `opt -O3 small.ll -o /dev/null` and inspect `llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h` around line 1196. Trace `LoopLoadEliminationPass` on function `main`, then reproduce with `small.c` and the shown profile-guided commands if needed. Done means the irreducible-control-flow crash no longer occurs at the reported optimization levels, with coverage for the reproducer.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.