[NFCI][SimpleLoopUnswitch] Adjust CostKind query
authorSam Parker <sam.parker@arm.com>
Fri, 14 Aug 2020 06:53:43 +0000 (07:53 +0100)
committerSam Parker <sam.parker@arm.com>
Fri, 14 Aug 2020 06:54:20 +0000 (07:54 +0100)
commit725400f9933fe58273d4500d8d6a77a438c43798
tree9af42cf4f1a72916098b8dd96f2885ec5ba2a037
parent95fad44e34c3c20263961a715571d798d90921f6
[NFCI][SimpleLoopUnswitch] Adjust CostKind query

When getUserCost was transitioned to use an explicit CostKind,
TCK_CodeSize was used even though the original kind was implicitly
SizeAndLatency so restore this behaviour. We now only query for
CodeSize when optimising for minsize.

I expect this to not change anything as, I think all, targets will
currently return the same value for CodeSize and SizeLatency. Indeed
I see no changes in the test suite for Arm, AArch64 and X86.

Differential Revision: https://reviews.llvm.org/D85829
llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
llvm/test/Transforms/SimpleLoopUnswitch/ARM/lit.local.cfg [new file with mode: 0644]
llvm/test/Transforms/SimpleLoopUnswitch/ARM/nontrivial-unswitch-cost.ll [new file with mode: 0644]