llvm / llvm/llvm-project

[FunctionAttrs] Unsound returned inference from nofpclass without noundef

Open
#185,266 1 comment 0 reactions 0 assignees View on GitHub
new issue
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Here is a miscompilation case:

```llvm
define float @use1_nofpclass_without_noundef(float nofpclass(nan) %x) {
ret float %x
}

define float @parent_poison(float %a) {
%r1 = call float @use1_nofpclass_without_noundef(float %a)
ret float %a
}
```

Transformed into:

```llvm
define float @use1_nofpclass_without_noundef(float returned nofpclass(nan) %x) #0 {
ret float %x
}

define float @parent_poison(float returned %a) #0 {
%r2 = call float @use1_nofpclass_without_noundef(float %a)
ret float %a
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
```

Alive2 proof: https://alive2.llvm.org/ce/z/FeNoja

This test case is generated when reviewing https://github.com/llvm/llvm-project/pull/183277. But I can't tell they're related.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.