AMDGPU: Report extractelement as free in cost model
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 1 Dec 2015 19:08:39 +0000 (19:08 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 1 Dec 2015 19:08:39 +0000 (19:08 +0000)
commit2320de6adb4f38633ae1698ac522def2bf0aacc5
treef6ec5833b236c79b7f3ecbfd612da5abde6c0df4
parent6cb642d909d9120d35d6ce3a499b075cc3b99a5d
AMDGPU: Report extractelement as free in cost model

The cost for scalarized operations is computed as N * (scalar operation
cost + 1 extractelement + 1 insertelement). This partially fixes
inflating the cost of scalarized operations since every operation is
scalarized and free. I don't think we want any cost asociated with
scalarization, but for now insertelement is still counted. I'm not sure
if we should pretend that insertelement is also free, or add a way
to compute a custom scalarization cost.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254438 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
test/Analysis/CostModel/AMDGPU/extractelement.ll [new file with mode: 0644]
test/Analysis/CostModel/AMDGPU/lit.local.cfg [new file with mode: 0644]