Convert cost table lookup functions to return a pointer to the entry or nullptr inste...
authorCraig Topper <craig.topper@gmail.com>
Tue, 27 Oct 2015 04:14:24 +0000 (04:14 +0000)
committerCraig Topper <craig.topper@gmail.com>
Tue, 27 Oct 2015 04:14:24 +0000 (04:14 +0000)
commit156f73362ef164405dceb74f7b1b04ad203bb43a
tree1f02b9c5d260e4295109a87c83ce9b7386b2566f
parent59991f96f9c522f456d9cb6d2eda4a226806d7ff
Convert cost table lookup functions to return a pointer to the entry or nullptr instead of the index.

This avoid mentioning the table name an extra time and allows the lookup to be done directly in the ifs by relying on the bool conversion of the pointer.

While there make use of ArrayRef and std::find_if.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251382 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/CostTable.h
lib/Target/AArch64/AArch64TargetTransformInfo.cpp
lib/Target/ARM/ARMTargetTransformInfo.cpp
lib/Target/X86/X86TargetTransformInfo.cpp