Page MenuHomePhabricator

[SLP][TTI][X86] Implement addsub cost calculation.
Needs ReviewPublic

Authored by vporpo on May 25 2022, 4:30 PM.

Details

Summary

This patch adds support for the addsub instructions in SLP's getEntryCost().
This relies on extending TTI->getShuffleCost() to return the correct cost
for such instructions.

Diff Detail

Unit TestsFailed

TimeTest
600 msx64 debian > LLVM.Transforms/SLPVectorizer/X86::lookahead.ll
Script: -- : 'RUN: at line 2'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/opt -slp-vectorizer -S < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Transforms/SLPVectorizer/X86/lookahead.ll -mtriple=x86_64-unknown-linux -mattr=+sse2 | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Transforms/SLPVectorizer/X86/lookahead.ll --check-prefixes=CHECK,SSE
530 msx64 debian > LLVM.Transforms/SLPVectorizer/X86::reorder_with_external_users.ll
Script: -- : 'RUN: at line 2'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/opt < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Transforms/SLPVectorizer/X86/reorder_with_external_users.ll -slp-vectorizer -S -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7-avx | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Transforms/SLPVectorizer/X86/reorder_with_external_users.ll
550 msx64 debian > LLVM.Transforms/SLPVectorizer/X86::supernode.ll
Script: -- : 'RUN: at line 2'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/opt -slp-vectorizer -S < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Transforms/SLPVectorizer/X86/supernode.ll -mtriple=x86_64-unknown-linux -mcpu=corei7-avx -verify | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Transforms/SLPVectorizer/X86/supernode.ll -check-prefix=ENABLED
540 msx64 debian > LLVM.Transforms/SLPVectorizer/X86::vectorize-widest-phis.ll
Script: -- : 'RUN: at line 2'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/opt -slp-vectorizer -S -mcpu=cascadelake -mtriple=x86_64-unknown-linux-gnu < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Transforms/SLPVectorizer/X86/vectorize-widest-phis.ll | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Transforms/SLPVectorizer/X86/vectorize-widest-phis.ll

Event Timeline

vporpo created this revision.May 25 2022, 4:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 25 2022, 4:30 PM
vporpo requested review of this revision.May 25 2022, 4:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 25 2022, 4:30 PM
vporpo updated this revision to Diff 432432.May 26 2022, 5:46 PM

Moved the cost calculation code from getShuffleCost() to a separate function: getAltInstrCost().