aboutsummaryrefslogtreecommitdiffstats
path: root/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
commit420820056d42c93ea64cd86a95848bf4e0040670 (patch)
treea73f96c47152923851234139e8840ea8a8c1808e /lib/CodeGen/BasicTargetTransformInfo.cpp
parentd9f88da7b329c54ccb0d2ebd3b3a4b0e4b1e2b06 (diff)
downloadexternal_llvm-420820056d42c93ea64cd86a95848bf4e0040670.zip
external_llvm-420820056d42c93ea64cd86a95848bf4e0040670.tar.gz
external_llvm-420820056d42c93ea64cd86a95848bf4e0040670.tar.bz2
Document the decision to assume that the cost of floats is twice as much as integers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179478 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BasicTargetTransformInfo.cpp')
-rw-r--r--lib/CodeGen/BasicTargetTransformInfo.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/BasicTargetTransformInfo.cpp b/lib/CodeGen/BasicTargetTransformInfo.cpp
index 499571f..4a99184 100644
--- a/lib/CodeGen/BasicTargetTransformInfo.cpp
+++ b/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)