llvm / llvm/llvm-project

Support `+inf` and `-inf` literals in MIR parser.

Open
#221,040 0 comments 0 reactions 0 assignees View on GitHub
floating-point llvm:codegen
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Currently, `MIR` does not support `+inf` and `-inf` literals.
```
# okay
G_FCONSTANT float 0x7FF0000000000000
G_FCONSTANT float f0x7F800000

# rejected
G_FCONSTANT float +inf
```

As noted here:
https://github.com/llvm/llvm-project/pull/221019#discussion_r3928024352

Contributor guide

Open the contributing guide

Research direction

Start at the MIR parser and trace how floating-point literals are currently recognized, using the accepted hexadecimal examples as a reference. Add support for both `+inf` and `-inf`, then verify that these literals are accepted while the existing forms continue to work.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
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.