Adding timing and space baseline cost for every OPs for evaluating

Here we are also computing the block’s timing and space cost at the llvm IR which is the sum of all OPs’ timing and space cost. This can help us do some graph-partition like calculating accelerating. Average-cost ops could be handled separately.
This project looks like cost model project in LLVM but this is for MLIR.
Could we add attributes of cost in llvmops.td file for every OPs?
This and give every op a baseline-cost while constructing. Also we may overwrite this cost in another pass after reading some CPU model settings.
We were thinking just let llvm as a submodule and store every cost in a json file or others. But this won’t update just as llvm source code changes. And codes themselves may be not very elegent.