Created attachment 24227 [details] bbi-50589_reduced.ll reproducer Reproduce with: opt -o - bbi-50589_reduced.ll -S -jump-threading It doesn't seem to terminate. This starts happening after 5486e00dc3e3: [InstSimplify] remove poison-unsafe insertelement of undef value PR45481: https://bugs.llvm.org/show_bug.cgi?id=45481 SDAG has an identical transform to this, so there's little chance of any real-world impact. OTOH, that means we are effectively sweeping the bug out of sight because poison exists in codegen too.
In the debugger, this is getting stuck in SimplifyExtractElementInst() -> llvm::findScalarElement().
I suspect that we could have hit this bug with a less-undef test case even before 5486e00dc3e3. I don't know much about jumpthreading, so I put in a lower-level exit in the analysis that was getting tripped up: https://reviews.llvm.org/rG9d6d24c25056
Thanks!