[mlir] Place MathToFuncs helpers in the nearest symbol table (#232582)
The MathToFuncs pass previously inserted every outlined ipowi, fpowi,
and ctlz helper into the top-level builtin.module. Calls rewritten
inside a gpu.module could not resolve those helpers because the
declarations were outside the nearest symbol table.
Create each helper in the symbol table nearest to its source operation.
Include that symbol table in the implementation cache key, and use the
same key when looking up helpers during conversion. This preserves reuse
for repeated calls in one module without sharing a definition across
distinct gpu.modules or the host module.
AI assistance: Portions of this patch and its regression test were
developed with assistance from OpenAI Codex. I have reviewed and
understand the submitted changes, and I take responsibility for them.