Document the decision to assume that the cost of floats is twice as much as integers.
authorNadav Rotem <nrotem@apple.com>
Sun, 14 Apr 2013 05:55:18 +0000 (05:55 +0000)
committerNadav Rotem <nrotem@apple.com>
Sun, 14 Apr 2013 05:55:18 +0000 (05:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179478 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/BasicTargetTransformInfo.cpp

index 499571fcac64f704a2894535cbb6f4bc7d5ff067..4a99184f5eecfaf5c9e8dd23ef09735cd2d034bd 100644 (file)
@@ -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)