llvm / llvm/llvm-project

[VectorCombine] New instructions aren't always pushed to the WorkList

Open
#211,519 1 comment 0 reactions 0 assignees View on GitHub
llvm:vectorcombine
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Inspired by #211508

A lot of folds seem to miss pushing new instructions onto the WorkList (and in the correct order), preventing further combines.

We should investigate using an IRBuilderInserter override (similar to IRBuilderInstCombineInserter) to handle all the WorkList::pushValue / replaceValue calls.

Failing that we could use a callback (or other mechanism) to help track that they have been added to the WorkList.

Warning: this is NOT a beginner issue.

Contributor guide

Open the contributing guide

Research direction

Start by comparing the context in #211508 and reading the existing IRBuilderInstCombineInserter. Trace the folds that call WorkList::pushValue or replaceValue and determine how the proposed inserter, callback, or other mechanism would preserve correct WorkList ordering. Done means new instructions are consistently tracked so further combines are not missed.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.