Closed chhzh123 closed 2 years ago
Ah, this is because FixedToInteger
pass hasn't implemented transformation on call
operation yet. I'll do it.
I rewrote the pass to generate the following code, where get_global_fixed
is inside the function (without involving the call operation), but why it still cannot work?
func private @Stage_B(%arg0: memref<4x6x8x8x!hcl.Fixed<26, 20>>, %arg1: memref<4x16x6x6x!hcl.Fixed<26, 20>>) attributes {bit, itypes = "__"} {
%c0 = arith.constant 0 : index
%0 = hcl.get_global_fixed @F : memref<16x6x3x3x!hcl.Fixed<26, 20>>
// more computation
return
}
func @top(%arg0: memref<4x6x8x8x!hcl.Fixed<26, 20>>) -> memref<4x16x6x6x!hcl.Fixed<26, 20>> attributes {itypes = "_", otypes = "_"} {
%0 = memref.alloc() {name = "B"} : memref<4x16x6x6x!hcl.Fixed<26, 20>>
call @Stage_B(%arg0, %0) : (memref<4x6x8x8x!hcl.Fixed<26, 20>>, memref<4x16x6x6x!hcl.Fixed<26, 20>>) -> ()
return %0 : memref<4x16x6x6x!hcl.Fixed<26, 20>>
}
I don't think this is related to hcl.get_global_fixed
, it's the function signature transformation when fixed-point type is involved. Let me fix this now
See this example, it works totally fine when the data type is
float
or no.outline()
primitive is used.However, when
.outline()
is used, it gives the following error.It seems correct from the generated IR.