[all-commits] [llvm/llvm-project] 638383: [SPIRV] Support G_IS_FPCLASS (#148637)

Fraser Cormack via All-commits all-commits at lists.llvm.org
Wed Jul 30 04:28:52 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 638383cb7110469d652c75a58b42afc80e863574
      https://github.com/llvm/llvm-project/commit/638383cb7110469d652c75a58b42afc80e863574
  Author: Fraser Cormack <fraser at codeplay.com>
  Date:   2025-07-30 (Wed, 30 Jul 2025)

  Changed paths:
    M llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp
    M llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.h
    A llvm/test/CodeGen/SPIRV/llvm-intrinsics/is_fpclass.ll

  Log Message:
  -----------
  [SPIRV] Support G_IS_FPCLASS (#148637)

This commit adds custom legalization for G_IS_FPCLASS, corresponding to
the @llvm.is.fpclass intrinsic.

The lowering strategy is essentially copied and adjusted from the
target-agnostic LegalizeHelper::lowerISFPCLASS legalization. The reason
we can't just use that directly is that the series of instruction it
expands to aren't logged in the SPIR-V backend's register/type
book-keeping, leading to issues later on in the compilation process.

As such the code introduced here was copied from the aforementioned
helper method, with some notable changes:

* Each new instruction's destination register must have a SPIR-V type
registered to it.
* Instead of a COPY from the floating-point type to integer, we issue a
SPIR-V OpBitcast directly. The backend doesn't currently appear to
handle bitcast-like COPYs.

Fixes #72862



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list