summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-04-14 05:55:18 +0000
committerNadav Rotem <nrotem@apple.com>2013-04-14 05:55:18 +0000
commit0db0690a70a8d654a974d9d5b24592e39b23870a (patch)
tree24fcce9b978a9a3997b4b93d9c7393e6092bdc68 /llvm/lib/CodeGen/BasicTargetTransformInfo.cpp
parenteed1072ff8a5ff0e750a5b5e3aa4bdbc59966240 (diff)
downloadbcm5719-llvm-0db0690a70a8d654a974d9d5b24592e39b23870a.tar.gz
bcm5719-llvm-0db0690a70a8d654a974d9d5b24592e39b23870a.zip
Document the decision to assume that the cost of floats is twice as much as integers.
llvm-svn: 179478
Diffstat (limited to 'llvm/lib/CodeGen/BasicTargetTransformInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/BasicTargetTransformInfo.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp b/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp
index 499571fcac6..4a99184f5ee 100644
--- a/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp
+++ b/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp
@@ -205,11 +205,13 @@ unsigned BasicTTI::getArithmeticInstrCost(unsigned Opcode, Type *Ty,
std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(Ty);
bool IsFloat = Ty->getScalarType()->isFloatingPointTy();
+ // Assume that floating point arithmetic operations cost twice as much as
+ // integer operations.
unsigned OpCost = (IsFloat ? 2 : 1);
if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
// The operation is legal. Assume it costs 1.
- // If the type is split to multiple registers, assume that thre is some
+ // If the type is split to multiple registers, assume that there is some
// overhead to this.
// TODO: Once we have extract/insert subvector cost we need to use them.
if (LT.first > 1)
OpenPOWER on IntegriCloud