[llvm] Reapply "[InstCombine] Merge consecutive assumes" (#205177) (PR #205324)

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 23 09:47:29 PDT 2026


thurstond wrote:

Some bots are breaking after this reland e.g.,
- https://lab.llvm.org/buildbot/#/builders/66/builds/32669
- https://lab.llvm.org/buildbot/#/builders/164/builds/22668
- https://lab.llvm.org/buildbot/#/builders/52/builds/18068

The crash is different this time (output below). Shameless plug - I think it will might be fixed by my https://github.com/llvm/llvm-project/pull/205275, but since that will take time to review/edit, would it be ok to revert this reland in the meantime to bring the bots back to green?

```
clang: /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Analysis/AssumptionCache.cpp:137: void llvm::AssumptionCache::removeAffectedValues(AssumeInst *): Assertion `Found && "already unregistered or incorrect cache state"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and dumped files.
Stack dump:
0.	Program arguments: /home/b/sanitizer-x86_64-linux/build/build_default/bin/clang -m64 -fPIC -flto -Oz -g0 -DNDEBUG -target x86_64-unknown-linux-gnu -Wno-unused-command-line-argument -include /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/sanitizer_common/symbolizer/../sanitizer_redefine_builtins.h -DSANITIZER_COMMON_REDEFINE_BUILTINS_IN_STD -Wno-language-extension-token -fno-rtti -fno-exceptions -fno-lto -c opt.bc -o symbolizer.o
1.	Optimizer
2.	Running pass "function<eager-inv>(drop-unnecessary-assumes,float2int,lower-constant-intrinsics,loop(loop-rotate<header-duplication;no-prepare-for-lto;check-exit-count>,loop-deletion),loop-distribute,inject-tli-mappings,loop-vectorize<no-interleave-forced-only;vectorize-forced-only;>,drop-unnecessary-assumes,infer-alignment,loop-load-elim,instcombine<max-iterations=1;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;forward-switch-cond;switch-range-to-icmp;switch-to-arithmetic;switch-to-lookup;no-keep-loops;hoist-common-insts;no-hoist-loads-stores-with-cond-faulting;sink-common-insts;speculate-blocks;simplify-cond-branch;no-speculate-unpredictables>,slp-vectorizer,vector-combine,instcombine<max-iterations=1;no-verify-fixpoint>,loop-unroll<O2>,transform-warning,sroa<preserve-cfg;aggregate-to-vector>,infer-alignment,instcombine<max-iterations=1;no-verify-fixpoint>,loop-mssa(licm<allowspeculation>),alignment-from-assumptions,loop-sink,instsimplify,div-rem-pairs,mergeicmps,expand-memcmp,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;switch-to-arithmetic;no-switch-to-lookup;keep-loops;no-hoist-common-insts;hoist-loads-stores-with-cond-faulting;no-sink-common-insts;speculate-blocks;simplify-cond-branch;speculate-unpredictables>)" on module "opt.bc"
3.	Running pass "drop-unnecessary-assumes" on function "_ZNK4llvm14DWARFDebugLine9LineTable22lookupAddressRangeImplENS_6object16SectionedAddressEmRNSt20__InternalSymbolizer6vectorIjNS4_9allocatorIjEEEENS4_8optionalImEE"
 #0 0x00005b462c4ed588 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/clang+0x9688588)
 #1 0x00005b462c4ea4c1 llvm::sys::RunSignalHandlers() (/home/b/sanitizer-x86_64-linux/build/build_default/bin/clang+0x96854c1)
 #2 0x00005b462c4ec17c llvm::sys::CleanupOnSignal(unsigned long) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/clang+0x968717c)
 #3 0x00005b462c4493e6 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #4 0x00007f4b94847e10 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x47e10)
 #5 0x00007f4b948ae3ec pthread_kill (/usr/lib/x86_64-linux-gnu/libc.so.6+0xae3ec)
 #6 0x00007f4b94847cde raise (/usr/lib/x86_64-linux-gnu/libc.so.6+0x47cde)
 #7 0x00007f4b948288ec abort (/usr/lib/x86_64-linux-gnu/libc.so.6+0x288ec)
 #8 0x00007f4b94829b92 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x29b92)
 #9 0x00007f4b9483e025 __assert_fail (/usr/lib/x86_64-linux-gnu/libc.so.6+0x3e025)
#10 0x00005b462b3b380b llvm::AssumptionCache::removeAffectedValues(llvm::AssumeInst*) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/clang+0x854e80b)
#11 0x00005b462b3b39bf llvm::AssumptionCache::replaceAssumption(llvm::WeakVH&, llvm::AssumeInst*) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/clang+0x854e9bf)
#12 0x00005b462dd9a1c6 llvm::DropUnnecessaryAssumesPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/home/b/sanitizer-x86_64-linux/build/build_default/bin/clang+0xaf351c6)
```

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


More information about the llvm-commits mailing list