[PATCH] D82065: [AMDGPU][CostModel] Add fneg cost estimation

Daniil Fukalov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 18 05:57:23 PDT 2020


dfukalov added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp:553
+  case ISD::FNEG:
+    return TLI->isFNegFree(SLT) ? 0 : LT.first * NElts;
   default:
----------------
arsenm wrote:
> If you're putting in in target code, might as well just return 0
There are different cases when fneg is not free. E.g. neg modifier can make instruction bigger. Or even explicit xor will be generated.
I tried to make cost model less independent from actual transforms. If one changes 
`isFNegFree()` behavior then cost model possible should be updated.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82065





More information about the llvm-commits mailing list