LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 48362 - opt -jump-threading hangs
Summary: opt -jump-threading hangs
Status: RESOLVED FIXED
Alias: None
Product: new-bugs
Classification: Unclassified
Component: new bugs (show other bugs)
Version: unspecified
Hardware: PC Linux
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-02 06:42 PST by Mikael Holmén
Modified: 2020-12-02 23:50 PST (History)
3 users (show)

See Also:
Fixed By Commit(s): 9d6d24c25


Attachments
bbi-50589_reduced.ll reproducer (3.25 KB, text/plain)
2020-12-02 06:42 PST, Mikael Holmén
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikael Holmén 2020-12-02 06:42:25 PST
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.
Comment 1 Sanjay Patel 2020-12-02 08:39:21 PST
In the debugger, this is getting stuck in SimplifyExtractElementInst() -> llvm::findScalarElement().
Comment 2 Sanjay Patel 2020-12-02 10:48:56 PST
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
Comment 3 Mikael Holmén 2020-12-02 23:50:54 PST
Thanks!