Page MenuHomePhabricator

[InstCombine] Sink bin op into hands of select if one hand becomes constant
Needs ReviewPublic

Authored by xbolva00 on Sep 4 2021, 1:42 PM.

Details

Summary

Restart of https://reviews.llvm.org/D71312 but more general.

Diff Detail

Unit TestsFailed

TimeTest
40 msx64 debian > LLVM.Transforms/LoopVectorize/ARM::mve-selectandorcost.ll
Script: -- : 'RUN: at line 2'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/opt -loop-vectorize -instcombine -simplifycfg < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Transforms/LoopVectorize/ARM/mve-selectandorcost.ll -S -o - | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Transforms/LoopVectorize/ARM/mve-selectandorcost.ll --check-prefix=CHECK
80 msx64 windows > LLVM.Transforms/LoopVectorize/ARM::mve-selectandorcost.ll
Script: -- : 'RUN: at line 2'; c:\ws\w4\llvm-project\premerge-checks\build\bin\opt.exe -loop-vectorize -instcombine -simplifycfg < C:\ws\w4\llvm-project\premerge-checks\llvm\test\Transforms\LoopVectorize\ARM\mve-selectandorcost.ll -S -o - | c:\ws\w4\llvm-project\premerge-checks\build\bin\filecheck.exe C:\ws\w4\llvm-project\premerge-checks\llvm\test\Transforms\LoopVectorize\ARM\mve-selectandorcost.ll --check-prefix=CHECK

Event Timeline

xbolva00 created this revision.Sep 4 2021, 1:42 PM
xbolva00 requested review of this revision.Sep 4 2021, 1:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 4 2021, 1:42 PM
xbolva00 added inline comments.Sep 4 2021, 1:45 PM
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
876

HACK just for initial patch.

We have some reverse transformation which creates infinite loop in IC with sub-minmax.ll.

Maybe bail out if matchSelectPattern returns something?