Bug type: crash
Component: LoopIdiomVectorize
Bug location: llvm/lib/Transforms/Vectorize/LoopIdiomVectorize.cpp: LoopIdiomVectorize::expandFindFirstByte
LoopIdiomVectorize::recognizeByteCompare
LoopIdiomVectorize::run
LoopIdiomVectorize::transformByteCompare
LoopIdiomVectorize::transformFindFirstByte
Issue title: Crash during Loop Deletion Pass
Labels: vectorizers
crash
Reported by: Sharjeel-Khan

We got a crash with the Android compiler based on 386af4a5c64ab75eaee2448dc38f2e34a40bfed0. I also checked with up-to-date clang and it stil crashes so it has not been fixed yet.

Backtrace:
```
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: /usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang++ -cc1 -triple aarch64-unknown-linux-android10000 -emit-llvm-bc -flto=thin -flto-unit -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name string_utils.cpp -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=non-leaf -relaxed-aliasing -ffp-contract=off -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -enable-tlsdesc -target-cpu cortex-a55 -target-feature +v9.2a -target-feature +bf16 -target-feature +bti -target-feature +ccidx -target-feature +complxnum -target-feature +crc -target-feature +dit -target-feature +dotprod -target-feature +flagm -target-feature +fp-armv8 -target-feature +fullfp16 -target-feature +i8mm -target-feature +jsconv -target-feature +lse -target-feature +mec -target-feature +neon -target-feature +pauth -target-feature +predres -target-feature +ras -target-feature +rcpc -target-feature +rdm -target-feature +rme -target-feature +sb -target-feature +spe-eef -target-feature +ssbs -target-feature +sve -target-feature +sve2 -target-feature +wfxt -target-feature +fix-cortex-a53-835769 -target-abi aapcs -msign-return-address=non-leaf -msign-return-address-key=a_key -mbranch-target-enforce -mguarded-control-stack -fdebug-info-for-profiling -debug-info-kind=constructor -dwarf-version=5 -debugger-tuning=gdb -gsimple-template-names=simple -debug-forward-template-params --compress-debug-sections=zstd -fdebug-compilation-dir=/proc/self/cwd -fdebug-prefix-map=/proc/self/cwd= -ffunction-sections -fdata-sections -funique-internal-linkage-names -fcoverage-compilation-dir=/proc/self/cwd -nostdsysteminc -sys-header-deps -D __BIONIC_NO_PAGE_SIZE_MACRO -D ANDROID -D NDEBUG -U DEBUG -D __compiler_offsetof=__builtin_offsetof -D __ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__ -D _FORTIFY_SOURCE=3 -D _LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -D __LIBC_API__=10000 -D __LIBM_API__=10000 -D __LIBDL_API__=10000 -D ANGLE_ENABLE_CONTEXT_MUTEX=1 -D ANGLE_ENABLE_CONTEXT_MUTEX_RECURSION=1 -D ANGLE_ENABLE_GLOBAL_MUTEX_LOAD_TIME_ALLOCATE=1 -D ANGLE_ENABLE_GLOBAL_MUTEX_RECURSION=1 -D ANGLE_ENABLE_SHARE_CONTEXT_LOCK=1 -D ANGLE_TEST_ENABLE_SYSTEM_EGL -D ANGLE_USE_ANDROID_TLS_SLOT=1 -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D ANGLE_ENABLE_CONTEXT_MUTEX=1 -D ANGLE_ENABLE_CONTEXT_MUTEX_RECURSION=1 -D ANGLE_ENABLE_GLOBAL_MUTEX_LOAD_TIME_ALLOCATE=1 -D ANGLE_ENABLE_GLOBAL_MUTEX_RECURSION=1 -D ANGLE_ENABLE_SHARE_CONTEXT_LOCK=1 -D ANGLE_TEST_ENABLE_SYSTEM_EGL -D ANGLE_USE_ANDROID_TLS_SLOT=1 -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ANDROID -D ANDROID_NDK_VERSION_ROLL=r28_1 -D CR_CLANG_REVISION=\"llvmorg-21-init-16348-gbd809ffb-17\" -D DYNAMIC_ANNOTATIONS_ENABLED=0 -D HAVE_SYS_UIO_H -D NDEBUG -D NVALGRIND -D _GNU_SOURCE -D _LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -D __ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__ -D ABSL_ALLOCATOR_NOTHROW=1 -D ABSL_ALLOCATOR_NOTHROW=1 -D ANGLE_ENABLE_CONTEXT_MUTEX=1 -D ANGLE_ENABLE_CONTEXT_MUTEX_RECURSION=1 -D ANGLE_ENABLE_GLOBAL_MUTEX_LOAD_TIME_ALLOCATE=1 -D ANGLE_ENABLE_GLOBAL_MUTEX_RECURSION=1 -D ANGLE_ENABLE_SHARE_CONTEXT_LOCK=1 -D ANGLE_TEST_ENABLE_SYSTEM_EGL -D ANGLE_USE_ABSEIL -D ANGLE_USE_ANDROID_TLS_SLOT=1 -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -D __ARM_NEON__=1 -O2 -Werror=implicit-function-declaration -Wall -Wextra -Wpointer-arith -Wunguarded-availability -Werror=bool-operation -Werror=date-time -Werror=int-conversion -Werror=multichar -Werror=pragma-pack -Werror=pragma-pack-suspicious-include -Werror=sizeof-array-div -Werror=sizeof-pointer-memaccess -Werror=string-plus-int -Werror=unreachable-code-loop-increment -Wno-error=deprecated-declarations -Wno-error=unused-variable -Wno-c23-extensions -Wno-c99-designator -Wno-gnu-folding-constant -Wno-inconsistent-missing-override -Wno-error=reorder-init-list -Wno-reorder-init-list -Wno-sign-compare -Wno-unused -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=format-security -Wno-enum-compare -Wno-enum-compare-switch -Wno-null-pointer-arithmetic -Wno-psabi -Wno-null-pointer-subtraction -Wno-string-concatenation -Wno-deprecated-non-prototype -Wno-unused -Wno-unused-but-set-variable -Wno-deprecated -Wno-tautological-constant-compare -Wimplicit-fallthrough -Wno-gnu-include-next -Werror -Wno-gnu-anonymous-struct -Wno-gnu-conditional-omitted-operand -Wno-gnu-include-next -Wno-gnu-label-as-value -Wno-gnu-redeclared-enum -Wno-gnu-statement-expression -Wno-gnu-zero-variadic-macro-arguments -Wno-implicit-fallthrough -Wno-thread-safety -Wno-zero-length-array -Wno-gnu-anonymous-struct -Wno-gnu-conditional-omitted-operand -Wno-gnu-include-next -Wno-gnu-label-as-value -Wno-gnu-redeclared-enum -Wno-gnu-statement-expression -Wno-gnu-zero-variadic-macro-arguments -Wno-thread-safety -Wno-zero-length-array -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-builtin-macro-redefined -Wno-cast-function-type -Wno-invalid-offsetof -Wno-missing-field-initializers -Wno-nontrivial-memcall -Wno-nullability-completeness -Wno-psabi -Wno-thread-safety-reference-return -Wno-trigraphs -Wno-unneeded-internal-declaration -Wno-unused-parameter -Wno-c++11-narrowing -Wno-exit-time-destructors -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-warning-option -Wno-gnu-anonymous-struct -Wno-gnu-conditional-omitted-operand -Wno-gnu-include-next -Wno-gnu-label-as-value -Wno-gnu-redeclared-enum -Wno-gnu-statement-expression -Wno-gnu-zero-variadic-macro-arguments -Wno-thread-safety -Wno-zero-length-array -Werror=address-of-temporary -Werror=dangling -Werror=format-insufficient-args -Werror=fortify-source -Werror=incompatible-function-pointer-types -Werror=int-in-bool-context -Werror=int-to-pointer-cast -Werror=null-dereference -Werror=return-type -Werror=xor-used-as-pow -Wno-pointer-to-int-cast -Wno-missing-field-initializers -Wno-packed-non-pod -Wno-error=tautological-constant-compare -Wno-implicit-int-float-conversion -Wno-tautological-overlap-compare -Wno-deprecated-copy -Wno-range-loop-construct -Wno-zero-as-null-pointer-constant -Wno-deprecated-anon-enum-enum-conversion -Wno-deprecated-enum-enum-conversion -Wno-error=pessimizing-move -Wno-non-c-typedef-for-linkage -Wno-align-mismatch -Wno-error=unused-but-set-parameter -Wno-error=deprecated -Wno-error=invalid-offsetof -Wno-nontrivial-memcall -Wno-invalid-specialization -Wno-vla-cxx-extension -Wno-cast-function-type-mismatch -Wno-unterminated-string-initialization -Wno-implicit-int-conversion-on-negation -Wno-default-const-init-field-unsafe -Wno-default-const-init-var-unsafe -Wno-preferred-type-bitfield-enum-conversion -Wno-implicit-enum-enum-cast -Wno-format-insufficient-args -Wno-misleading-indentation -Wno-unused -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-unused-variable -Wno-unqualified-std-cast-call -Wno-array-parameter -Wno-gnu-offsetof-extensions -Wno-pessimizing-move -std=gnu++20 -ferror-limit 19 -fvisibility=hidden -fvisibility-inlines-hidden -ftrivial-auto-var-init=zero -fno-rtti -fno-signed-char -fgnuc-version=4.2.1 -fno-implicit-modules -fskip-odr-check-in-gmf -fcommon -fcolor-diagnostics -vectorize-loops -vectorize-slp -target-feature +mte -mllvm -improved-fs-discriminator=true -mllvm -enable-fs-discriminator=true -mllvm -dom-tree-reachability-max-bbs-to-explore=128 -fsanitize=memtag-stack,memtag-globals -fno-sanitize-memory-param-retval -fno-sanitize-address-use-odr-indicator -fsplit-lto-unit -target-feature +outline-atomics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -x c++ string_utils-ed6705.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>,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;prepare-for-lto>,licm<allowspeculation>,simple-loop-unswitch<no-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>))),function(invalidate<should-not-run-function-passes>),cgscc(devirt<4>())" on module "string_utils-ed6705.cpp"
4.	Running pass "cgscc(devirt<4>(inline,function-attrs<skip-non-recursive-function-attrs>,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;prepare-for-lto>,licm<allowspeculation>,simple-loop-unswitch<no-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>)))" on module "string_utils-ed6705.cpp"
5.	Running pass "loop(loop-idiom,indvars,extra-simple-loop-unswitch-passes,loop-idiom-vectorize,loop-deletion,loop-unroll-full)" on function "_ZN5angle26SplitStringAlongWhitespaceERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPNS0_6vectorIS6_NS4_IS6_EEEE"
 #0 0x000055a6d6ed9d4b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x3f00d4b)
 #1 0x000055a6d6ed6e3a SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x00007fd958849df0 (/lib/x86_64-linux-gnu/libc.so.6+0x3fdf0)
 #3 0x000055a6dac1b623 llvm::LoopDeletionPass::run(llvm::Loop&, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x7c42623)
 #4 0x000055a6d7ee9c2d llvm::detail::PassModel<llvm::Loop, llvm::LoopDeletionPass, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>::run(llvm::Loop&, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x4f10c2d)
 #5 0x000055a6d6ce2ef2 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&) (.isra.0) LoopPassManager.cpp:0:0
 #6 0x000055a6d6ce41d9 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&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x3d0b1d9)
 #7 0x000055a6d6ce488f 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&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x3d0b88f)
 #8 0x000055a6d6ce5354 llvm::FunctionToLoopPassAdaptor::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x3d0c354)
 #9 0x000055a6d429b52d llvm::detail::PassModel<llvm::Function, llvm::FunctionToLoopPassAdaptor, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x12c252d)
#10 0x000055a6d682bc48 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x3852c48)
#11 0x000055a6d429b64d llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x12c264d)
#12 0x000055a6d5d3beb2 llvm::CGSCCToFunctionPassAdaptor::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x2d62eb2)
#13 0x000055a6d429a38d 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&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x12c138d)
#14 0x000055a6d5d338dc 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&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x2d5a8dc)
#15 0x000055a6d7ee86ad 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&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x4f0f6ad)
#16 0x000055a6d5d38a6a llvm::DevirtSCCRepeatedPass::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x2d5fa6a)
#17 0x000055a6d7ee86cd 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&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x4f0f6cd)
#18 0x000055a6d5d35fb2 llvm::ModuleToPostOrderCGSCCPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x2d5cfb2)
#19 0x000055a6d429a36d llvm::detail::PassModel<llvm::Module, llvm::ModuleToPostOrderCGSCCPassAdaptor, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x12c136d)
#20 0x000055a6d6826088 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x384d088)
#21 0x000055a6d85eddf1 llvm::ModuleInlinerWrapperPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x5614df1)
#22 0x000055a6d7ee81dd llvm::detail::PassModel<llvm::Module, llvm::ModuleInlinerWrapperPass, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x4f0f1dd)
#23 0x000055a6d6826088 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x384d088)
#24 0x000055a6d719d508 (anonymous namespace)::EmitAssemblyHelper::RunOptimizationPipeline(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>&, std::unique_ptr<llvm::ToolOutputFile, std::default_delete<llvm::ToolOutputFile>>&, clang::BackendConsumer*) BackendUtil.cpp:0:0
#25 0x000055a6d71a0886 clang::emitBackendOutput(clang::CompilerInstance&, clang::CodeGenOptions&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x41c7886)
#26 0x000055a6d77d62d9 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x47fd2d9)
#27 0x000055a6d91cbe5c clang::ParseAST(clang::Sema&, bool, bool) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x61f2e5c)
#28 0x000055a6d7b10eba clang::FrontendAction::Execute() (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x4b37eba)
#29 0x000055a6d7a8b23e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x4ab223e)
#30 0x000055a6d7beeab7 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0x4c15ab7)
#31 0x000055a6d3e90efd cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0xeb7efd)
#32 0x000055a6d3e88e83 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#33 0x000055a6d3e8c93e clang_main(int, char**, llvm::ToolContext const&) (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0xeb393e)
#34 0x000055a6d3d2ba93 main (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0xd52a93)
#35 0x00007fd958833ca8 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#36 0x00007fd958833d65 call_init ./csu/../csu/libc-start.c:128:20
#37 0x00007fd958833d65 __libc_start_main ./csu/../csu/libc-start.c:347:5
#38 0x000055a6d3e888d1 _start (/usr/local/google/home/sharjeelkhan/Development/build-2/bin/clang+++0xeaf8d1)
```

[string_utils-ed6705.cpp](https://github.com/user-attachments/files/22109784/string_utils-ed6705.cpp)
[string_utils-ed6705.sh](https://github.com/user-attachments/files/22109981/string_utils-ed6705.sh)

Comments: author: Sharjeel-Khan
body: I was able to bisect that the issue started from 5f84b6edd97153f1e5ec00ce110108ba8f6048bd
author: Sharjeel-Khan
body: Hi @rj-jesus, you might have a better idea why this crash happened.
author: rj-jesus
body: Hi @Sharjeel-Khan, thank you for the report. :) The issue seems to be in updating the PHI successors for ExitFail, where we should be doing something similar to `fixSuccessorPhis` in `LoopIdiomVectorize::transformByteCompare`. I'll aim to open a PR to fix this soon, but incidentally I'll be on holiday starting tomorrow for the next two weeks. If we don't manage to fix this in the meantime and if this is urgent to you, please let me know and I'll disable the transformation by default until we get it sorted.
author: Sharjeel-Khan
body: It is urgent because it blocks the clang update for Android. 
author: sjoerdmeijer
body: Hi @Sharjeel-Khan, as I wrote in [#156945](https://github.com/llvm/llvm-project/pull/156945), I have taken this over from Ricardo. If you could test this patch, and check if there is no other fall out from this, that would be really helpful. 
author: Sharjeel-Khan
body: Thanks @sjoerdmeijer, I am testing it now so just give me an hour to test it with Android. I'll post in the PR based on the testing

Fix patch:
commit 2873d9fac550a248a1c62cfc106ac31fef84fa7d
Author: Sjoerd Meijer <smeijer@nvidia.com>
Date:   Fri Sep 5 14:05:07 2025 +0100

    [LoopIdiomVectorize] Fix FindFirstByte successors (#156945)
    
    This refactors fixSuccessorPhis from
    LoopIdiomVectorize::transformByteCompare and uses it in
    LoopIdiomVectorize::expandFindFirstByte to ensure that all successor
    Phis have incoming values from the vector basic blocks.
    
    Fixes #156588.
    
    ---------
    
    Co-authored-by: Ricardo Jesus <rjj@nvidia.com>

diff --git a/llvm/lib/Transforms/Vectorize/LoopIdiomVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopIdiomVectorize.cpp
index 8d1915a6a5ed..53129e2e5fbb 100644
--- a/llvm/lib/Transforms/Vectorize/LoopIdiomVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopIdiomVectorize.cpp
@@ -170,10 +170,10 @@ private:
   bool recognizeFindFirstByte();
 
   Value *expandFindFirstByte(IRBuilder<> &Builder, DomTreeUpdater &DTU,
-                             unsigned VF, Type *CharTy, BasicBlock *ExitSucc,
-                             BasicBlock *ExitFail, Value *SearchStart,
-                             Value *SearchEnd, Value *NeedleStart,
-                             Value *NeedleEnd);
+                             unsigned VF, Type *CharTy, Value *IndPhi,
+                             BasicBlock *ExitSucc, BasicBlock *ExitFail,
+                             Value *SearchStart, Value *SearchEnd,
+                             Value *NeedleStart, Value *NeedleEnd);
 
   void transformFindFirstByte(PHINode *IndPhi, unsigned VF, Type *CharTy,
                               BasicBlock *ExitSucc, BasicBlock *ExitFail,
@@ -242,6 +242,37 @@ bool LoopIdiomVectorize::run(Loop *L) {
   return false;
 }
 
+static void fixSuccessorPhis(Loop *L, Value *ScalarRes, Value *VectorRes,
+                             BasicBlock *SuccBB, BasicBlock *IncBB) {
+  for (PHINode &PN : SuccBB->phis()) {
+    // Look through the incoming values to find ScalarRes, meaning this is a
+    // PHI collecting the results of the transformation.
+    bool ResPhi = false;
+    for (Value *Op : PN.incoming_values())
+      if (Op == ScalarRes) {
+        ResPhi = true;
+        break;
+      }
+
+    // Any PHI that depended upon the result of the transformation needs a new
+    // incoming value from IncBB.
+    if (ResPhi)
+      PN.addIncoming(VectorRes, IncBB);
+    else {
+      // There should be no other outside uses of other values in the
+      // original loop. Any incoming values should either:
+      //   1. Be for blocks outside the loop, which aren't interesting. Or ..
+      //   2. These are from blocks in the loop with values defined outside
+      //      the loop. We should a similar incoming value from CmpBB.
+      for (BasicBlock *BB : PN.blocks())
+        if (L->contains(BB)) {
+          PN.addIncoming(PN.getIncomingValueForBlock(BB), IncBB);
+          break;
+        }
+    }
+  }
+}
+
 bool LoopIdiomVectorize::recognizeByteCompare() {
   // Currently the transformation only works on scalable vector types, although
   // there is no fundamental reason why it cannot be made to work for fixed
@@ -935,42 +966,10 @@ void LoopIdiomVectorize::transformByteCompare(GetElementPtrInst *GEPA,
     DTU.applyUpdates({{DominatorTree::Insert, CmpBB, FoundBB}});
   }
 
-  auto fixSuccessorPhis = [&](BasicBlock *SuccBB) {
-    for (PHINode &PN : SuccBB->phis()) {
-      // At this point we've already replaced all uses of the result from the
-      // loop with ByteCmp. Look through the incoming values to find ByteCmp,
-      // meaning this is a Phi collecting the results of the byte compare.
-      bool ResPhi = false;
-      for (Value *Op : PN.incoming_values())
-        if (Op == ByteCmpRes) {
-          ResPhi = true;
-          break;
-        }
-
-      // Any PHI that depended upon the result of the byte compare needs a new
-      // incoming value from CmpBB. This is because the original loop will get
-      // deleted.
-      if (ResPhi)
-        PN.addIncoming(ByteCmpRes, CmpBB);
-      else {
-        // There should be no other outside uses of other values in the
-        // original loop. Any incoming values should either:
-        //   1. Be for blocks outside the loop, which aren't interesting. Or ..
-        //   2. These are from blocks in the loop with values defined outside
-        //      the loop. We should a similar incoming value from CmpBB.
-        for (BasicBlock *BB : PN.blocks())
-          if (CurLoop->contains(BB)) {
-            PN.addIncoming(PN.getIncomingValueForBlock(BB), CmpBB);
-            break;
-          }
-      }
-    }
-  };
-
   // Ensure all Phis in the successors of CmpBB have an incoming value from it.
-  fixSuccessorPhis(EndBB);
+  fixSuccessorPhis(CurLoop, ByteCmpRes, ByteCmpRes, EndBB, CmpBB);
   if (EndBB != FoundBB)
-    fixSuccessorPhis(FoundBB);
+    fixSuccessorPhis(CurLoop, ByteCmpRes, ByteCmpRes, FoundBB, CmpBB);
 
   // The new CmpBB block isn't part of the loop, but will need to be added to
   // the outer loop if there is one.
@@ -1168,8 +1167,9 @@ bool LoopIdiomVectorize::recognizeFindFirstByte() {
 
 Value *LoopIdiomVectorize::expandFindFirstByte(
     IRBuilder<> &Builder, DomTreeUpdater &DTU, unsigned VF, Type *CharTy,
-    BasicBlock *ExitSucc, BasicBlock *ExitFail, Value *SearchStart,
-    Value *SearchEnd, Value *NeedleStart, Value *NeedleEnd) {
+    Value *IndPhi, BasicBlock *ExitSucc, BasicBlock *ExitFail,
+    Value *SearchStart, Value *SearchEnd, Value *NeedleStart,
+    Value *NeedleEnd) {
   // Set up some types and constants that we intend to reuse.
   auto *PtrTy = Builder.getPtrTy();
   auto *I64Ty = Builder.getInt64Ty();
@@ -1369,6 +1369,12 @@ Value *LoopIdiomVectorize::expandFindFirstByte(
   MatchLCSSA->addIncoming(Search, BB2);
   MatchPredLCSSA->addIncoming(MatchPred, BB2);
 
+  // Ensure all Phis in the successors of BB3/BB5 have an incoming value from
+  // them.
+  fixSuccessorPhis(CurLoop, IndPhi, MatchVal, ExitSucc, BB3);
+  if (ExitSucc != ExitFail)
+    fixSuccessorPhis(CurLoop, IndPhi, MatchVal, ExitFail, BB5);
+
   if (VerifyLoops) {
     OuterLoop->verifyLoop();
     InnerLoop->verifyLoop();
@@ -1390,21 +1396,12 @@ void LoopIdiomVectorize::transformFindFirstByte(
   DomTreeUpdater DTU(DT, DomTreeUpdater::UpdateStrategy::Lazy);
   Builder.SetCurrentDebugLocation(PHBranch->getDebugLoc());
 
-  Value *MatchVal =
-      expandFindFirstByte(Builder, DTU, VF, CharTy, ExitSucc, ExitFail,
-                          SearchStart, SearchEnd, NeedleStart, NeedleEnd);
+  expandFindFirstByte(Builder, DTU, VF, CharTy, IndPhi, ExitSucc, ExitFail,
+                      SearchStart, SearchEnd, NeedleStart, NeedleEnd);
 
   assert(PHBranch->isUnconditional() &&
          "Expected preheader to terminate with an unconditional branch.");
 
-  // Add new incoming values with the result of the transformation to PHINodes
-  // of ExitSucc that use IndPhi.
-  for (auto *U : llvm::make_early_inc_range(IndPhi->users())) {
-    auto *PN = dyn_cast<PHINode>(U);
-    if (PN && PN->getParent() == ExitSucc)
-      PN->addIncoming(MatchVal, cast<Instruction>(MatchVal)->getParent());
-  }
-
   if (VerifyLoops && CurLoop->getParentLoop()) {
     CurLoop->getParentLoop()->verifyLoop();
     if (!CurLoop->getParentLoop()->isRecursivelyLCSSAForm(*DT, *LI))


Regression tests:
file: llvm/test/Transforms/LoopIdiom/AArch64/find-first-byte.ll
commands: opt -mtriple=aarch64 -mattr=+sve -passes='loop(loop-idiom-vectorize)' -verify-loop-info -verify-dom-info -S < %s
opt -mtriple=aarch64 -mattr=+sve -passes='loop(loop-idiom-vectorize)' -disable-loop-idiom-vectorize-find-first-byte -S < %s
tests: test_name: ensure_not_found_successors_fixed2
test_body: define ptr @ensure_not_found_successors_fixed2(ptr %search_start, ptr %search_end, ptr %needle_start, ptr %needle_end) #0 {
entry:
  %dummy_val = getelementptr i8, ptr %search_start, i64 1
  br label %header

header:                                           ; preds = %search_check, %entry
  %search_ptr = phi ptr [ %search_next, %search_check ], [ %search_start, %entry ]
  %search_load = load i8, ptr %search_ptr, align 1
  br label %match_check

needle_check:                                     ; preds = %match_check
  %needle_next = getelementptr i8, ptr %needle_ptr, i64 1
  %needle_cmp = icmp eq ptr %needle_next, %needle_end
  br i1 %needle_cmp, label %search_check, label %match_check

match_check:                                      ; preds = %needle_check, %header
  %needle_ptr = phi ptr [ %needle_start, %header ], [ %needle_next, %needle_check ]
  %needle_load = load i8, ptr %needle_ptr, align 1
  %match_cmp = icmp eq i8 %search_load, %needle_load
  br i1 %match_cmp, label %found_match, label %needle_check

search_check:                                     ; preds = %needle_check
  %search_next = getelementptr i8, ptr %search_ptr, i64 1
  %search_cmp = icmp eq ptr %search_next, %search_end
  br i1 %search_cmp, label %not_found, label %header

found_match:                                      ; preds = %match_check
  ret ptr %search_ptr

not_found:                                        ; preds = %search_check
  %unused = phi ptr [ %dummy_val, %search_check ]
  ret ptr null
}

attributes #0 = { "target-features"="+sve2" }

test_name: ensure_not_found_successors_fixed
test_body: define ptr @ensure_not_found_successors_fixed(ptr %search_start, ptr %search_end, ptr %needle_start, ptr %needle_end) #0 {
entry:
  br label %header

header:                                           ; preds = %search_check, %entry
  %search_ptr = phi ptr [ %search_next, %search_check ], [ %search_start, %entry ]
  %search_load = load i8, ptr %search_ptr, align 1
  br label %match_check

needle_check:                                     ; preds = %match_check
  %needle_next = getelementptr i8, ptr %needle_ptr, i64 1
  %needle_cmp = icmp eq ptr %needle_next, %needle_end
  br i1 %needle_cmp, label %search_check, label %match_check

match_check:                                      ; preds = %needle_check, %header
  %needle_ptr = phi ptr [ %needle_start, %header ], [ %needle_next, %needle_check ]
  %needle_load = load i8, ptr %needle_ptr, align 1
  %match_cmp = icmp eq i8 %search_load, %needle_load
  br i1 %match_cmp, label %found_match, label %needle_check

search_check:                                     ; preds = %needle_check
  %search_next = getelementptr i8, ptr %search_ptr, i64 1
  %search_cmp = icmp eq ptr %search_next, %search_end
  br i1 %search_cmp, label %not_found, label %header

found_match:                                      ; preds = %match_check
  ret ptr %search_ptr

not_found:                                        ; preds = %search_check
  %unused = phi i64 [ 0, %search_check ]
  ret ptr null
}

attributes #0 = { "target-features"="+sve2" }