[all-commits] [llvm/llvm-project] 06ab30: [AMDGPU] Constant folding of llvm.amdgcn.trig.preo...

Changpeng Fang via All-commits all-commits at lists.llvm.org
Thu Jul 18 09:40:59 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 06ab30b57450694818dbb649dec2a687f44df7f4
      https://github.com/llvm/llvm-project/commit/06ab30b57450694818dbb649dec2a687f44df7f4
  Author: Changpeng Fang <changpeng.fang at amd.com>
  Date:   2024-07-18 (Thu, 18 Jul 2024)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
    M llvm/test/Transforms/InstCombine/AMDGPU/amdgcn-intrinsics.ll

  Log Message:
  -----------
  [AMDGPU] Constant folding of llvm.amdgcn.trig.preop (#98562)

If the parameters(the input and segment select) coming in to
amdgcn.trig.preop intrinsic are compile time constants, we pre-compute
the output of amdgcn.trig.preop on the CPU and replaces the uses with
the computed constant.

This work extends the patch https://reviews.llvm.org/D120150 to make it
a complete coverage.

For the segment select, only src1[4:0] are used. A segment select is
invalid if we are selecting the 53-bit segment beyond the [1200:0] range
of the 2/PI table. 0 is returned when a segment select is not valid.



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