[llvm] [Transforms] LoopIdiomRecognize recognize strlen and wcslen (PR #108985)
LLVM Continuous Integration via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 14 18:42:10 PDT 2025
llvm-ci wrote:
LLVM Buildbot has detected a new failure on builder `premerge-monolithic-linux` running on `premerge-linux-1` while building `llvm` at step 7 "test-build-unified-tree-check-all".
Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/25840
<details>
<summary>Here is the relevant piece of the build log for the reference</summary>
```
Step 7 (test-build-unified-tree-check-all) failure: test (failure)
...
0.037 [1/7/5] Building CXX object compiler-rt/lib/memprof/CMakeFiles/RTMemprof_dynamic_version_script_dummy.x86_64.dir/dummy.cpp.o
0.093 [0/7/6] Linking CXX shared library /build/buildbot/premerge-monolithic-linux/build/lib/clang/21/lib/x86_64-unknown-linux-gnu/libclang_rt.ubsan_standalone.so
0.093 [0/6/7] Linking CXX shared library /build/buildbot/premerge-monolithic-linux/build/lib/clang/21/lib/x86_64-unknown-linux-gnu/libclang_rt.nsan.so
0.093 [0/5/8] Linking CXX shared library /build/buildbot/premerge-monolithic-linux/build/lib/clang/21/lib/x86_64-unknown-linux-gnu/libclang_rt.hwasan.so
0.094 [0/4/9] Linking CXX shared library /build/buildbot/premerge-monolithic-linux/build/lib/clang/21/lib/x86_64-unknown-linux-gnu/libclang_rt.hwasan_aliases.so
0.097 [0/3/10] Linking CXX shared library /build/buildbot/premerge-monolithic-linux/build/lib/clang/21/lib/x86_64-unknown-linux-gnu/libclang_rt.memprof.so
0.105 [0/2/11] Linking CXX shared library /build/buildbot/premerge-monolithic-linux/build/lib/clang/21/lib/x86_64-unknown-linux-gnu/libclang_rt.asan.so
0.577 [0/1/12] Generating /build/buildbot/premerge-monolithic-linux/build/compile_commands.json
23.662 [3/1/144] cd /build/buildbot/premerge-monolithic-linux/build/runtimes/runtimes-bins && /etc/cmake/bin/cmake --build /build/buildbot/premerge-monolithic-linux/build/runtimes/runtimes-bins/ --target runtimes-test-depends --config Release
5.399 [0/1/1] Checking TSan Go runtime...
FAILED: compiler-rt/lib/tsan/rtl/CMakeFiles/GotsanRuntimeCheck /build/buildbot/premerge-monolithic-linux/build/runtimes/runtimes-bins/compiler-rt/lib/tsan/rtl/CMakeFiles/GotsanRuntimeCheck
cd /build/buildbot/premerge-monolithic-linux/llvm-project/compiler-rt/lib/tsan/go && env "CC=/build/buildbot/premerge-monolithic-linux/build/./bin/clang " EXTRA_CFLAGS= IN_TMPDIR=1 SILENT=1 /build/buildbot/premerge-monolithic-linux/llvm-project/compiler-rt/lib/tsan/rtl/../go/buildgo.sh
clang: /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:1788: bool (anonymous namespace)::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: /build/buildbot/premerge-monolithic-linux/build/./bin/clang /tmp/gotsan.6tc8ZIP9Vl/gotsan.cpp -c -o /tmp/gotsan.6tc8ZIP9Vl/race_linux_amd64.syso -I../rtl -I../.. -I../../sanitizer_common -I../../../include -std=c++17 -Wall -fno-exceptions -fno-rtti -DSANITIZER_GO=1 -DSANITIZER_DEADLOCK_DETECTOR_VERSION=2 -fPIC -Wno-maybe-uninitialized -ffreestanding -Wno-unused-const-variable -Wno-unknown-warning-option -m64 -msse3 -DSANITIZER_DEBUG=0 -O3 -fomit-frame-pointer
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-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 "/tmp/gotsan.6tc8ZIP9Vl/gotsan.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-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 "/tmp/gotsan.6tc8ZIP9Vl/gotsan.cpp"
5. Running pass "loop(loop-idiom,indvars,extra-simple-loop-unswitch-passes,loop-deletion,loop-unroll-full)" on function "_ZN11__sanitizer15internal_wcslenEPKw"
#0 0x00005b4af6c40388 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/lib/Support/Unix/Signals.inc:804:13
#1 0x00005b4af6c3debe llvm::sys::RunSignalHandlers() /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/lib/Support/Signals.cpp:106:18
#2 0x00005b4af6ba8266 HandleCrash /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:73:5
#3 0x00005b4af6ba8266 CrashRecoverySignalHandler(int) /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:390:51
#4 0x00007a0a6b4e7520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#5 0x00007a0a6b53b9fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#6 0x00007a0a6b4e7476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#7 0x00007a0a6b4cd7f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#8 0x00007a0a6b4cd71b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#9 0x00007a0a6b4dee96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#10 0x00005b4af88b23c1 (/build/buildbot/premerge-monolithic-linux/build/./bin/clang+0xa2f33c1)
#11 0x00005b4af88ac79d llvm::LoopIdiomRecognizePass::run(llvm::Loop&, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&) /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:291:7
#12 0x00005b4af83f9e0d 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&) /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:91:5
#13 0x00005b4af6a90cf8 skipCurrentLoop /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h:237:41
#14 0x00005b4af6a90cf8 std::optional<llvm::PreservedAnalyses> llvm::PassManager<llvm::Loop, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>::runSinglePass<llvm::Loop, std::unique_ptr<llvm::detail::PassConcept<llvm::Loop, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>, std::default_delete<llvm::detail::PassConcept<llvm::Loop, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>>>>(llvm::Loop&, std::unique_ptr<llvm::detail::PassConcept<llvm::Loop, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>, std::default_delete<llvm::detail::PassConcept<llvm::Loop, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>>>&, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&, llvm::PassInstrumentation&) /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h:378:9
#15 0x00005b4af6a90972 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&) /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/lib/Transforms/Scalar/LoopPassManager.cpp:160:9
#16 0x00005b4af6a8ff62 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&) /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/lib/Transforms/Scalar/LoopPassManager.cpp:0:32
#17 0x00005b4af82e9bbd llvm::detail::PassModel<llvm::Loop, llvm::PassManager<llvm::Loop, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>::run(llvm::Loop&, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&) /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:91:5
#18 0x00005b4af6a91c52 skipCurrentLoop /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h:237:41
#19 0x00005b4af6a91c52 llvm::FunctionToLoopPassAdaptor::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/lib/Transforms/Scalar/LoopPassManager.cpp:305:17
#20 0x00005b4af45e0add llvm::detail::PassModel<llvm::Function, llvm::FunctionToLoopPassAdaptor, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:91:5
#21 0x00005b4af665f94a llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/include/llvm/IR/PassManagerImpl.h:85:8
#22 0x00005b4af45c44dd llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:91:5
#23 0x00005b4af5c39253 llvm::CGSCCToFunctionPassAdaptor::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/lib/Analysis/CGSCCPassManager.cpp:551:23
#24 0x00005b4af45c418d 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&) /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:91:5
#25 0x00005b4af5c34774 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&) /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/lib/Analysis/CGSCCPassManager.cpp:93:12
#26 0x00005b4af82fa3ad 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&) /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:91:5
#27 0x00005b4af5c37544 llvm::DevirtSCCRepeatedPass::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/lib/Analysis/CGSCCPassManager.cpp:0:38
```
</details>
https://github.com/llvm/llvm-project/pull/108985
More information about the llvm-commits
mailing list