[libcxx-commits] [libcxx] [libc++] Optimize std::find_if (PR #167697)

Thurston Dang via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 13 10:49:15 PST 2026


thurstond wrote:

I think one of the buildbots is failing due to this change (https://lab.llvm.org/buildbot/#/builders/25/builds/14798). Could you please take a look?

```
==> /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/sanitizer_logs/report.opt.4103412 <==
/home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:131:40: runtime error: applying zero offset to null pointer
    #0 0x5d7aa3699092 in end /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:131:40
    #1 0x5d7aa3699092 in llvm::slpvectorizer::BoUpSLP::gather(llvm::ArrayRef<llvm::Value*>, llvm::Value*, llvm::Type*, llvm::function_ref<llvm::Value* (llvm::Value*, llvm::Value*, llvm::ArrayRef<int>)>)::$_0::operator()(llvm::Value*, llvm::Value*, unsigned int, llvm::Type*) const /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:18534:25
...
```

```
18528    if (isa<Instruction>(V)) {
18529      ArrayRef<TreeEntry *> Entries = getTreeEntries(V);
18530      const auto *It = find_if(Entries, [&](const TreeEntry *E) {
18531        return !TransformedToGatherNodes.contains(E) &&
18532               !DeletedNodes.contains(E);
18533      });
18534      if (It != Entries.end()) {
```

```
iterator end() const { return Data + Length; }
```


https://github.com/llvm/llvm-project/pull/167697


More information about the libcxx-commits mailing list