llvm / llvm/llvm-project

[KnownFPClass] `G_INTRINSIC_FPTRUNC_ROUND` is incorrectly handled

Open
#221,010 0 comments 0 reactions 0 assignees View on GitHub
llvm:globalisel
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

https://github.com/llvm/llvm-project/blob/89082772bed1ed16c0311b12147a96c35bb063d8/llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp#L1579-L1586

`G_INTRINSIC_FPTRUNC_ROUND` is incorrectly handled as an integer-rounding intrinsic instead of a floating point truncation intrinsic.

We would also need to tests for `G_INTRINSIC_FPTRUNC_ROUND`.

Contributor guide

Open the contributing guide

Research direction

Start in llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp at lines 1579-1586 and inspect how G_INTRINSIC_FPTRUNC_ROUND is classified. Add coverage for this intrinsic, verifying that it is handled as floating-point truncation rather than integer rounding. Done means the new tests pass and cover the corrected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.