llvm / llvm/llvm-project

Problematic codegen with __builtin_isfpclass and vector types

Open
#216,420 3 comments 0 reactions 0 assignees View on GitHub
backend:AArch64 backend:X86 floating-point llvm:instcombine miscompilation missed-optimization
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

``__builtin_isfpclass`` is specified to have support for vector builtins
https://clang.llvm.org/docs/LanguageExtensions.html#builtin-isfpclass

but the codegen can also end up wrong (x86, arm, ...)
or suboptimal (avx512) when using it

Examples
https://minimal.godbolt.org/z/59eb3vbGe

Contributor guide

Open the contributing guide

Research direction

Start with the linked Godbolt example and the Clang Language Extensions documentation for __builtin_isfpclass. Compare generated code for the vector cases across the affected x86, Arm, and AVX-512 targets, then identify the relevant compiler codegen and test locations. Done means correct codegen on the affected targets and improved AVX-512 output, covered by regression tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.