Page MenuHomePhabricator

[SLP]Improve/fix CSE analysis of the blocks/instructions.
ClosedPublic

Authored by ABataev on Oct 5 2022, 9:05 AM.

Details

Summary

Added analysis for invariant extractelement instructions and improved
detection of the CSE blocks for generated extractelement instructions.

Diff Detail

Unit TestsFailed

TimeTest
60,050 msx64 debian > MLIR.Examples/standalone::test.toy
Script: -- : 'RUN: at line 1'; /usr/bin/cmake /var/lib/buildkite-agent/builds/llvm-project/mlir/examples/standalone -G "Ninja" -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang -DLLVM_ENABLE_LIBCXX=OFF -DMLIR_DIR=/var/lib/buildkite-agent/builds/llvm-project/build/lib/cmake/mlir -DLLVM_USE_LINKER=lld -DPython3_EXECUTABLE="/usr/bin/python3.9"

Event Timeline

ABataev created this revision.Oct 5 2022, 9:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 5 2022, 9:05 AM
ABataev requested review of this revision.Oct 5 2022, 9:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 5 2022, 9:05 AM
vdmitrie added inline comments.Oct 5 2022, 11:31 AM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
8715

At this point Ex is guaranteed to be an instruction. So why dyn_cast?

8746

same seems applies here.

8839

and here

ABataev added inline comments.Oct 5 2022, 11:58 AM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
8715

Just want to be safe, remember some conflicts with possible ConstExprs as operands. I can change it to cast

vdmitrie added inline comments.Oct 5 2022, 1:07 PM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
8715

I don't think such "safety" measure has good justification. If for some reason the cast fires an assertion it will be easy to understand what happened. Otherwise you would allow the issue to go further which sometimes might result in hard to trace performance issues.

ABataev updated this revision to Diff 465734.Oct 6 2022, 7:55 AM

Rebase, tried to address comments

vdmitrie accepted this revision.Oct 6 2022, 9:32 AM

LG. Thanks!

This revision is now accepted and ready to land.Oct 6 2022, 9:32 AM
This revision was automatically updated to reflect the committed changes.