Our hardware has a cache which is fully controlled by software.
When generating machine instruction, the actual physical address, and the size in the cache
must be known at the compile time as constant numbers.
Suppose an IR similar to
pooling(memref, memref, memref)
can be directly lowered to machine instruction if the address of memref are all fixed.
How to specify the fixed address of memref in the IR?
The type itself does not allow one to specify the address in a way that it can be known at compile time. You can consider defining a new operation that produces a memref pointing to a specific address (specified as an attribute of that operation), and provide special treatment for values of memref type defined by this operation in your code. We used to have such an operation long time ago, but I don’t see anymore.