[llvm] r179478 - Document the decision to assume that the cost of floats is twice as much as integers.

Nadav Rotem nrotem at apple.com
Sat Apr 13 22:55:18 PDT 2013


Author: nadav
Date: Sun Apr 14 00:55:18 2013
New Revision: 179478

URL: http://llvm.org/viewvc/llvm-project?rev=179478&view=rev
Log:
Document the decision to assume that the cost of floats is twice as much as integers.

Modified:
    llvm/trunk/lib/CodeGen/BasicTargetTransformInfo.cpp

Modified: llvm/trunk/lib/CodeGen/BasicTargetTransformInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BasicTargetTransformInfo.cpp?rev=179478&r1=179477&r2=179478&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/BasicTargetTransformInfo.cpp (original)
+++ llvm/trunk/lib/CodeGen/BasicTargetTransformInfo.cpp Sun Apr 14 00:55:18 2013
@@ -205,11 +205,13 @@ unsigned BasicTTI::getArithmeticInstrCos
   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)





More information about the llvm-commits mailing list