[all-commits] [llvm/llvm-project] 7c366b: [DirectX] Implement `llvm.is.fpclass` lowering for...

Deric C. via All-commits all-commits at lists.llvm.org
Thu May 8 09:13:49 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7c366b041cd0effdcf0b7e1f3a7ad4eb39800349
      https://github.com/llvm/llvm-project/commit/7c366b041cd0effdcf0b7e1f3a7ad4eb39800349
  Author: Deric C. <cheung.deric at gmail.com>
  Date:   2025-05-08 (Thu, 08 May 2025)

  Changed paths:
    M llvm/lib/Target/DirectX/DXIL.td
    M llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp
    M llvm/lib/Target/DirectX/DXILOpLowering.cpp
    A llvm/test/CodeGen/DirectX/is_fpclass.ll

  Log Message:
  -----------
  [DirectX] Implement `llvm.is.fpclass` lowering for the fcNegZero FPClassTest and the `IsNaN`, `IsInf`, `IsFinite`, `IsNormal` DXIL ops (#138048)

Fixes #137209

This PR:
- Adds a case to `expandIntrinsic()` in `DXILIntrinsicExpansion.cpp` to
expand the `Intrinsic::is_fpclass` in the case of
`FPClassTest::fcNegZero`
- Defines the `IsNaN`, `IsFinite`, `IsNormal` DXIL ops in `DXIL.td`
- Adds a case to `lowerIntrinsics()` in `DXILOpLowering.cpp` to handle
the lowering of `Intrinsic::is_fpclass` to the DXIL ops `IsNaN`,
`IsInf`, `IsFinite`, `IsNormal` when the FPClassTest is `fcNan`,
`fcInf`, `fcFinite`, and `fcNormal` respectively
- Creates a test `llvm/test/CodeGen/DirectX/is_fpclass.ll` to exercise
the intrinsic expansion and DXIL op lowering of `Intrinsic::is_fpclass`

~~A separate PR will be made to remove the now-redundant `dx_isinf`
intrinsic to address #87777.~~

A proper implementation for the lowering of the `llvm.is.fpclass`
intrinsic to handle all possible combinations of FPClassTest can be
implemented in a separate PR. This PR's implementation focuses primarily
on addressing the current use-cases for DirectML and HLSL intrinsics.



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