[llvm] [ValueTracking] Add missing check for two-value PN recurrance matching (PR #152700)

Ivan R. Ivanov via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 8 06:03:41 PDT 2025


ivanradanov wrote:

I added a test. For reference, before the patch, this is how it crashes:
```
AnalysisTests: src/llvm-project/llvm/include/llvm/IR/InstrTypes.h:2353: Value *llvm::CallBase::getOperand(unsigned int) const: Assertion `i_nocapture < OperandTraits<CallBase>::operands(this) && "getOperand() out of range!"' failed.
```
I also noticed that the `== 2` does not work for intrinsics as they also have the callee argument so I changed to `>= 2`

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


More information about the llvm-commits mailing list