[TLI] Add a new hook to TargetLowering to query the target if a load of a constant...
authorJuergen Ributzka <juergen@apple.com>
Tue, 28 Jan 2014 01:20:14 +0000 (01:20 +0000)
committerJuergen Ributzka <juergen@apple.com>
Tue, 28 Jan 2014 01:20:14 +0000 (01:20 +0000)
commitefbb39740c32b6b8311d27b0f279a7d523fbdf2d
tree098939cea9469e21535ce923015b5f0b4c1330d2
parenta47aa4b4efb2b6c5944c2edb9a4346c0f3ffcaf1
[TLI] Add a new hook to TargetLowering to query the target if a load of a constant should be converted to simply the constant itself.

Before this patch we used getIntImmCost from TargetTransformInfo to determine if
a load of a constant should be converted to just a constant, but the threshold
for this was set to an arbitrary value. This value works well for the two
targets (X86 and ARM) that implement this target-hook, but it isn't
target-independent at all.

Now targets have the possibility to decide directly if this optimization should
be performed. The default value is set to false to preserve the current
behavior. The target hook has been moved to TargetLowering, which removed the
last use and need of TargetTransformInfo in SelectionDAG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200271 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/TargetTransformInfo.h
include/llvm/CodeGen/SelectionDAG.h
include/llvm/CodeGen/SelectionDAGISel.h
include/llvm/Target/TargetLowering.h
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/ARM/ARMISelLowering.h
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h