Hi,
I have created one Bufferization
pass on toy example, which will convert toy.constant to memref.global, But after emitting IR, the constant string mentioned inside double inverted comma, like "constant***"
.
The Full IR looks like
module {
memref.global "private" constant @"constant_\01" : memref<8xf64> = dense<[1.200000e+00, 2.100000e+00, 4.700000e+00, 1.900000e+00, 1.100000e+00, 2.900000e+00, 2.700000e+00, 7.500000e+00]>
memref.global "private" constant @"constant_\00" : memref<8xf64> = dense<[1.300000e+00, 2.600000e+00, 4.200000e+00, 1.100000e+00, 1.900000e+00, 2.200000e+00, 2.500000e+00, 7.700000e+00]>
func.func @main() {
%alloc = memref.alloc() : memref<8xf64>
%alloc_0 = memref.alloc() : memref<8xf64>
%alloc_1 = memref.alloc() : memref<8xf64>
%0 = memref.get_global @"constant_\00" : memref<8xf64>
memref.copy %0, %alloc_1 : memref<8xf64> to memref<8xf64>
%1 = memref.get_global @"constant_\01" : memref<8xf64>
memref.copy %1, %alloc_0 : memref<8xf64> to memref<8xf64>
affine.for %arg0 = 0 to 2 step 4 {
%2 = affine.vector_load %alloc_1[%arg0] : memref<8xf64>, vector<4xf64>
%3 = affine.vector_load %alloc_0[%arg0] : memref<8xf64>, vector<4xf64>
%4 = poseidon.add %2, %3 : vector<4xf64>
affine.vector_store %4, %alloc[%arg0] : memref<8xf64>, vector<4xf64>
}
toy.print %alloc : memref<8xf64>
memref.dealloc %alloc_1 : memref<8xf64>
memref.dealloc %alloc_0 : memref<8xf64>
memref.dealloc %alloc : memref<8xf64>
return
}
}
When I studied the memref dialect, the first example is
// Private variable with an initial value.
memref.global "private" @x : memref<2xf32> = dense<0.0,2.0>
so how to solve this issue? Please help !!!