[TIR] How to get constant parameters values in TIR pass

Hi all!

Is it possible to get the value of a constant parameter inside a TIR pass?

I need to write a pass to insert some if-else clauses, but this depends on the values of the constant parameters of the function. So I need to check for the values of the constant parameters, and depending on that, insert or not insert this if-else clauses.

Is this possible? Is there any transform pass that does something similar (evaluate the value of a constant)?

Thanks!

So, I was looking at this again, trying to access the values of constants inside a prim_func_pass. Inside my _ftransform function, I have the buffer_map of the function and the params… is it possible to get the values of the constant from these attributes?

Does the ExtractPrimFuncConstants TIR transform can be used to do this? Or does this transform only extract the allocate_const operators?