[CodeGenPrepare] Refine the cost model provided by the promotion helper.
authorQuentin Colombet <qcolombet@apple.com>
Tue, 10 Mar 2015 21:48:15 +0000 (21:48 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Tue, 10 Mar 2015 21:48:15 +0000 (21:48 +0000)
commit7775242da34fcacdec50b28daec173084be618ad
treef19efcac5cb258d82df0c9e42c2ccf3b5d33c7d6
parent31f1cc579090a2763203400939494d50f7f3e5fb
[CodeGenPrepare] Refine the cost model provided by the promotion helper.
- Use TargetLowering to check for the actual cost of each extension.
- Provide a factorized method to check for the cost of an extension:
  TargetLowering::isExtFree.
- Provide a virtual method TargetLowering::isExtFreeImpl for targets to be able
  to tune the cost of non-free extensions.

This refactoring offers a better granularity to model what really happens on
different targets.

No performance changes and very few code differences.

Part of <rdar://problem/19267165>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231855 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetLowering.h
lib/CodeGen/CodeGenPrepare.cpp
test/CodeGen/X86/codegen-prepare-addrmode-sext.ll
test/CodeGen/X86/codegen-prepare-extload.ll