[llvm] [SPIR-V] Implement SPV_KHR_float_controls2 (PR #146941)
Nathan Gauër via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 7 07:19:08 PDT 2025
https://github.com/Keenuts commented:
Started to review but I have a more global question first:
Seems like you do some stuff multiple times:
- check the metadata on the module, and emit default decorations (`outputFPFastMathDefaultInfo`)
- check metadata on all the rest, and emit decorations (later in the same `SPIRVAsmPrinter` function)
- then merge flags you find from the OpDecorate instruction, checking for conflicts
Code seems a bit convoluted to me with parts that could definitely be refactored (ex the iteration on each type and MI construction for the decoration)
Looks like the metadata gathering, flag conflict validation and only then decoration emission could be split into distinct, independent pieces.
Another question: reading the float_control2 spec, seems like it could be enabled for Shaders since the capability is not gated by the Kernel one. But looks like the SPIRVAsmPrinter part is gated on `ST->isKernel`
https://github.com/llvm/llvm-project/pull/146941
More information about the llvm-commits
mailing list