[TLI] Add a new hook to TargetLowering to query the target if a load of a…

Press ? to show keyboard shortcuts.
Committed
ributzkaJan 27 2014, 5:20 PM
Parents
rL200270: LoopVectorize: Support conditional stores by scalarizing
Branches
Unknown
Tags
Unknown
Description

[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.

rL200271

llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h

Loading...

llvm/trunk/include/llvm/CodeGen/SelectionDAG.h

Loading...

llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h

Loading...

llvm/trunk/include/llvm/Target/TargetLowering.h

Loading...

llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Loading...

llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Loading...

llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp

Loading...

llvm/trunk/lib/Target/ARM/ARMISelLowering.h

Loading...

llvm/trunk/lib/Target/X86/X86ISelLowering.cpp

Loading...

llvm/trunk/lib/Target/X86/X86ISelLowering.h

Loading...

Add Comment