This patch considers the experimental vector reduce intrinsics in the default implementation of getIntrinsicInstrCost. The cost of these intrinsics is computed with getArithmeticReductionCost and getMinMaxReductionCost. This patch also adds a test case for AArch64 that indicates the costs we currently compute for vector reduce intrinsics. These costs are inaccurate and will be updated in a follow-on patch.
Details
Diff Detail
- Repository
- rL LLVM
- Build Status
Buildable 16083 Build 16083: arc lint + arc unit
Event Timeline
Hi Mathew,
Why can't this be an extension of getIntrinsicInstrCost itself? It already has that logic (and much more)...
Also, my comments are related to further extensions of this function (if necessary), as well as for extending getIntrinsicInstrCost.
I fear we'll end up with a big list of lambdas before the actual switches, all to wrap common variables and safety asserts.
cheers,
--renato
lib/Analysis/TargetTransformInfo.cpp | ||
---|---|---|
1144 | these wrappers do seems cumbersome and mostly unnecessary. You could move the assert into getArithmeticReductionCost and getMinMaxReductionCost and avoid it altogether. | |
1171 | And here you can cache the values of Args[0]->getType(), etc. and just repeat the pattern. |
Thanks a lot for taking a look at the patch, Renato! Ah, I missed the implementation of getIntrinsicInstrCost over in BasicTTIImpl.h. I agree - it definitely makes sense to move this logic there. I'll update the patch with your suggestions.
these wrappers do seems cumbersome and mostly unnecessary. You could move the assert into getArithmeticReductionCost and getMinMaxReductionCost and avoid it altogether.