[llvm] r346670 - [CostModel][X86] Add some initial cost tests for funnel shifts

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 12 13:32:54 PST 2018


Currently this is purely used to test the XOP code path, but given the 
existing cpu tests I thought it'd be interesting, I can replace it with 
an +attr test if you prefer?

At some point we'll start splicing these cost tables to use the 
scheduler models. D46276 is a WIP patch that demonstrates how to do just 
that, but its some way off yet (still seeing issues with ugly code 
bloat, accuracy and usefulness etc.) - and ideally it'd allow us to get 
throughput, latency and code size costs.

On 12/11/2018 17:07, Roman Lebedev wrote:
> On Mon, Nov 12, 2018 at 7:42 PM Simon Pilgrim via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
>> Author: rksimon
>> Date: Mon Nov 12 08:39:41 2018
>> New Revision: 346670
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=346670&view=rev
>> Log:
>> [CostModel][X86] Add some initial cost tests for funnel shifts
>>
>> Still need to add full uniform/constant coverage but this is enough to check basic fshl/fshr cost handling
>>
>> Added:
>>      llvm/trunk/test/Analysis/CostModel/X86/fshl.ll
>>      llvm/trunk/test/Analysis/CostModel/X86/fshr.ll
>>
>> Added: llvm/trunk/test/Analysis/CostModel/X86/fshl.ll
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/CostModel/X86/fshl.ll?rev=346670&view=auto
>> ==============================================================================
>> --- llvm/trunk/test/Analysis/CostModel/X86/fshl.ll (added)
>> +++ llvm/trunk/test/Analysis/CostModel/X86/fshl.ll Mon Nov 12 08:39:41 2018
>> @@ -0,0 +1,390 @@
>> +; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
>> +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+ssse3 | FileCheck %s --check-prefixes=CHECK,SSE,SSSE3
>> +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+sse4.2 | FileCheck %s --check-prefixes=CHECK,SSE,SSE42
>> +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx | FileCheck %s --check-prefixes=CHECK,AVX,AVX1
>> +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx2 | FileCheck %s --check-prefixes=CHECK,AVX,AVX2
>> +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512F
>> +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512BW
>> +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512DQ
>> +;
>> +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=slm | FileCheck %s --check-prefixes=SLM
>> +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=goldmont | FileCheck %s --check-prefixes=GLM
>> +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=bdver2 | FileCheck %s --check-prefixes=BDVER2
> Note that i intentionally *not* added bdver2 into existing costmodel tests.
> I wasn't sure it gives any additional test coverage, especially since
> bdver2 is not marked as CompleteModel,
> (FIXME: when i do, nothing seems to break. is the check for sched
> model completeness just bad?),
> and D46276 is not there yet.
>
> Should bdver2 be checked in test/Analysis/CostModel/X86/* ?
>
> Roman.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181112/ba5218df/attachment.html>


More information about the llvm-commits mailing list