Files
clang-p2996/llvm/test/Transforms/InstCombine/AMDGPU
Changpeng Fang 06ab30b574 [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.
2024-07-18 09:40:37 -07:00
..