[llvm] [Transforms] LoopIdiomRecognize recognize strlen and wcslen (PR #108985)
LLVM Continuous Integration via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 14 16:14:03 PDT 2025
llvm-ci wrote:
LLVM Buildbot has detected a new failure on builder `lldb-remote-linux-ubuntu` running on `as-builder-9` while building `llvm` at step 7 "build-default".
Full details are available at: https://lab.llvm.org/buildbot/#/builders/195/builds/6210
<details>
<summary>Here is the relevant piece of the build log for the reference</summary>
```
Step 7 (build-default) failure: cmake (failure)
...
1.265 [493/66/2364] Building CXX object libcxx/src/CMakeFiles/cxx_static.dir/expected.cpp.o
1.268 [492/66/2365] Building CXX object libcxx/src/CMakeFiles/cxx_static.dir/typeinfo.cpp.o
1.272 [491/66/2366] Building CXX object compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.aarch64.dir/sanitizer_common.cpp.o
1.279 [490/66/2367] Building CXX object compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.aarch64.dir/sanitizer_linux_libcdep.cpp.o
1.286 [489/66/2368] Building CXX object compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.aarch64.dir/sanitizer_symbolizer_report.cpp.o
1.290 [488/66/2369] Building CXX object libcxxabi/src/CMakeFiles/cxxabi_static_objects.dir/cxa_exception_storage.cpp.o
1.293 [487/66/2370] Building CXX object libcxxabi/src/CMakeFiles/cxxabi_static_objects.dir/cxa_thread_atexit.cpp.o
1.294 [486/66/2371] Building CXX object compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.aarch64.dir/sanitizer_flags.cpp.o
1.296 [485/66/2372] Building CXX object compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.aarch64.dir/sanitizer_procmaps_common.cpp.o
1.331 [484/66/2373] Building CXX object compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.aarch64.dir/sanitizer_libc.cpp.o
FAILED: compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.aarch64.dir/sanitizer_libc.cpp.o
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang++ --target=aarch64-unknown-linux-gnu -DHAVE_RPC_XDR_H=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/compiler-rt/lib/sanitizer_common/.. -mcpu=cortex-a78 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wall -Wno-unused-parameter -O3 -DNDEBUG -std=c++17 -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -ftrivial-auto-var-init=pattern -nostdinc++ -Wno-format -fno-rtti -Wframe-larger-than=570 -Wglobal-constructors -MD -MT compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.aarch64.dir/sanitizer_libc.cpp.o -MF compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.aarch64.dir/sanitizer_libc.cpp.o.d -o compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.aarch64.dir/sanitizer_libc.cpp.o -c /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_libc.cpp
clang++: /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:1788: bool {anonymous}::LoopIdiomRecognize::recognizeAndInsertStrLen(): Assertion `StrLenFunc && "Failed to emit strlen function."' failed.
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: /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang++ --target=aarch64-unknown-linux-gnu -DHAVE_RPC_XDR_H=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/compiler-rt/lib/sanitizer_common/.. -mcpu=cortex-a78 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wall -Wno-unused-parameter -O3 -DNDEBUG -std=c++17 -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -ftrivial-auto-var-init=pattern -nostdinc++ -Wno-format -fno-rtti -Wframe-larger-than=570 -Wglobal-constructors -MD -MT compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.aarch64.dir/sanitizer_libc.cpp.o -MF compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.aarch64.dir/sanitizer_libc.cpp.o.d -o compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.aarch64.dir/sanitizer_libc.cpp.o -c /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_libc.cpp
1. <eof> parser at end of file
2. Optimizer
3. Running pass "require<globals-aa>,function(invalidate<aa>),require<profile-summary>,cgscc(devirt<4>(inline,function-attrs<skip-non-recursive-function-attrs>,argpromotion,openmp-opt-cgscc,function<eager-inv;no-rerun>(sroa<modify-cfg>,early-cse<memssa>,speculative-execution<only-if-divergent-target>,jump-threading,correlated-propagation,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-hoist-loads-stores-with-cond-faulting;no-sink-common-insts;speculate-blocks;simplify-cond-branch;no-speculate-unpredictables>,instcombine<max-iterations=1;no-verify-fixpoint>,aggressive-instcombine,libcalls-shrinkwrap,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-hoist-loads-stores-with-cond-faulting;no-sink-common-insts;speculate-blocks;simplify-cond-branch;no-speculate-unpredictables>,reassociate,constraint-elimination,loop-mssa(loop-instsimplify,loop-simplifycfg,licm<no-allowspeculation>,loop-rotate<header-duplication;no-prepare-for-lto>,licm<allowspeculation>,simple-loop-unswitch<nontrivial;trivial>),simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-hoist-loads-stores-with-cond-faulting;no-sink-common-insts;speculate-blocks;simplify-cond-branch;no-speculate-unpredictables>,instcombine<max-iterations=1;no-verify-fixpoint>,loop(loop-idiom,indvars,extra-simple-loop-unswitch-passes,loop-idiom-vectorize,loop-deletion,loop-unroll-full),sroa<modify-cfg>,vector-combine,mldst-motion<no-split-footer-bb>,gvn<>,sccp,bdce,instcombine<max-iterations=1;no-verify-fixpoint>,jump-threading,correlated-propagation,adce,memcpyopt,dse,move-auto-init,loop-mssa(licm<allowspeculation>),coro-elide,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;hoist-common-insts;no-hoist-loads-stores-with-cond-faulting;sink-common-insts;speculate-blocks;simplify-cond-branch;no-speculate-unpredictables>,instcombine<max-iterations=1;no-verify-fixpoint>),function-attrs,function(require<should-not-run-function-passes>),coro-split,coro-annotation-elide)),function(invalidate<should-not-run-function-passes>),cgscc(devirt<4>())" on module "/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_libc.cpp"
4. Running pass "cgscc(devirt<4>(inline,function-attrs<skip-non-recursive-function-attrs>,argpromotion,openmp-opt-cgscc,function<eager-inv;no-rerun>(sroa<modify-cfg>,early-cse<memssa>,speculative-execution<only-if-divergent-target>,jump-threading,correlated-propagation,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-hoist-loads-stores-with-cond-faulting;no-sink-common-insts;speculate-blocks;simplify-cond-branch;no-speculate-unpredictables>,instcombine<max-iterations=1;no-verify-fixpoint>,aggressive-instcombine,libcalls-shrinkwrap,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-hoist-loads-stores-with-cond-faulting;no-sink-common-insts;speculate-blocks;simplify-cond-branch;no-speculate-unpredictables>,reassociate,constraint-elimination,loop-mssa(loop-instsimplify,loop-simplifycfg,licm<no-allowspeculation>,loop-rotate<header-duplication;no-prepare-for-lto>,licm<allowspeculation>,simple-loop-unswitch<nontrivial;trivial>),simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-hoist-loads-stores-with-cond-faulting;no-sink-common-insts;speculate-blocks;simplify-cond-branch;no-speculate-unpredictables>,instcombine<max-iterations=1;no-verify-fixpoint>,loop(loop-idiom,indvars,extra-simple-loop-unswitch-passes,loop-idiom-vectorize,loop-deletion,loop-unroll-full),sroa<modify-cfg>,vector-combine,mldst-motion<no-split-footer-bb>,gvn<>,sccp,bdce,instcombine<max-iterations=1;no-verify-fixpoint>,jump-threading,correlated-propagation,adce,memcpyopt,dse,move-auto-init,loop-mssa(licm<allowspeculation>),coro-elide,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;hoist-common-insts;no-hoist-loads-stores-with-cond-faulting;sink-common-insts;speculate-blocks;simplify-cond-branch;no-speculate-unpredictables>,instcombine<max-iterations=1;no-verify-fixpoint>),function-attrs,function(require<should-not-run-function-passes>),coro-split,coro-annotation-elide))" on module "/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_libc.cpp"
5. Running pass "loop(loop-idiom,indvars,extra-simple-loop-unswitch-passes,loop-idiom-vectorize,loop-deletion,loop-unroll-full)" on function "_ZN11__sanitizer15internal_wcslenEPKw"
#0 0x000057ab154a44b2 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang+++0x22394b2)
#1 0x000057ab154a151f llvm::sys::RunSignalHandlers() (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang+++0x223651f)
#2 0x000057ab153e0ae8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x0000747d4a645330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
#4 0x0000747d4a69eb2c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9eb2c)
#5 0x0000747d4a64527e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
#6 0x0000747d4a6288ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
#7 0x0000747d4a62881b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
#8 0x0000747d4a63b517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
#9 0x000057ab1949dc0e (anonymous namespace)::LoopIdiomRecognize::recognizeAndInsertStrLen() LoopIdiomRecognize.cpp:0:0
#10 0x000057ab194a782b llvm::LoopIdiomRecognizePass::run(llvm::Loop&, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang+++0x623c82b)
#11 0x000057ab16a77235 llvm::detail::PassModel<llvm::Loop, llvm::LoopIdiomRecognizePass, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>::run(llvm::Loop&, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang+++0x380c235)
#12 0x000057ab194c90e3 llvm::PassManager<llvm::Loop, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>::runWithoutLoopNestPasses(llvm::Loop&, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang+++0x625e0e3)
#13 0x000057ab194c8bbb llvm::PassManager<llvm::Loop, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>::run(llvm::Loop&, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang+++0x625dbbb)
#14 0x000057ab194ca135 llvm::FunctionToLoopPassAdaptor::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang+++0x625f135)
#15 0x000057ab16a73655 llvm::detail::PassModel<llvm::Function, llvm::FunctionToLoopPassAdaptor, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang+++0x3808655)
#16 0x000057ab14f431da llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang+++0x1cd81da)
#17 0x000057ab15732135 llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang+++0x24c7135)
#18 0x000057ab196e9736 llvm::CGSCCToFunctionPassAdaptor::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang+++0x647e736)
#19 0x000057ab16a72535 llvm::detail::PassModel<llvm::LazyCallGraph::SCC, llvm::CGSCCToFunctionPassAdaptor, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang+++0x3807535)
#20 0x000057ab196e2766 llvm::PassManager<llvm::LazyCallGraph::SCC, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang+++0x6477766)
#21 0x000057ab16a72495 llvm::detail::PassModel<llvm::LazyCallGraph::SCC, llvm::PassManager<llvm::LazyCallGraph::SCC, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang+++0x3807495)
#22 0x000057ab196ea7a5 llvm::DevirtSCCRepeatedPass::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang+++0x647f7a5)
#23 0x000057ab16a724e5 llvm::detail::PassModel<llvm::LazyCallGraph::SCC, llvm::DevirtSCCRepeatedPass, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang+++0x38074e5)
#24 0x000057ab196e6089 llvm::ModuleToPostOrderCGSCCPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang+++0x647b089)
#25 0x000057ab16a72445 llvm::detail::PassModel<llvm::Module, llvm::ModuleToPostOrderCGSCCPassAdaptor, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang+++0x3807445)
#26 0x000057ab14f420cd llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang+++0x1cd70cd)
#27 0x000057ab16d61637 llvm::ModuleInlinerWrapperPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang+++0x3af6637)
```
</details>
https://github.com/llvm/llvm-project/pull/108985
More information about the llvm-commits
mailing list