[PATCH] D76124: [TTI] Remove getOperationCost

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 7 10:20:12 PDT 2020


spatel added inline comments.


================
Comment at: llvm/include/llvm/Analysis/TargetTransformInfoImpl.h:844
+      break;
+    case Instruction::GetElementPtr: {
+      const GEPOperator *GEP = cast<GEPOperator>(U);
----------------
The earlier review comment shifted, but I think it still applies. The GEP opcode is always handled above here, right?


================
Comment at: llvm/include/llvm/Analysis/TargetTransformInfoImpl.h:861
+      if (getCastInstrCost(Opcode, Ty, OpTy, I) == TTI::TCC_Free ||
+          TargetTTI->getCastInstrCost(Opcode, Ty, OpTy, I) == TTI::TCC_Free)
+        return TTI::TCC_Free;
----------------
This still isn't clear to me (let me know if I'm misunderstanding and/or reading too much into this). 

getCastInstrCost() returns some integer value as a cost. Do we really want to use the "TCC_Free" enum value as an alias for "0" in the comparison statement? If we are going to use that definition, then do we need to update the documentation comments to specify that TCC_Free is a designated return value and fixed at zero?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76124/new/

https://reviews.llvm.org/D76124





More information about the llvm-commits mailing list