[CostModel] Add basic implementation of getGatherScatterOpCost.
authorFlorian Hahn <flo@fhahn.com>
Wed, 25 Nov 2020 17:27:11 +0000 (17:27 +0000)
committerFlorian Hahn <flo@fhahn.com>
Thu, 26 Nov 2020 12:02:25 +0000 (12:02 +0000)
commit926681b6be701176f4f806e28932e8013fe4dec1
treecd6d9a2db6fc1e4e1c0e0753246f456463da1e7b
parent45ba2392d7e00aedd4d9fb04070dbae8a7fbbeeb
[CostModel] Add basic implementation of getGatherScatterOpCost.

Add a basic implementation of getGatherScatterOpCost to BasicTTIImpl.

The implementation estimates the cost of scalarizing the loads/stores,
the cost of packing/extracting the individual lanes and the cost of
only selecting enabled lanes.

This more accurately reflects the current cost on targets like AArch64.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D91984
llvm/include/llvm/CodeGen/BasicTTIImpl.h
llvm/test/Analysis/CostModel/AArch64/mem-op-cost-model.ll
llvm/test/Transforms/SLPVectorizer/AArch64/gather-cost.ll