| Issue |
175526
|
| Summary |
Attributor fails to introduce nofpclass on function return with assume
|
| Labels |
missed-optimization,
floating-point,
llvm::Attributor
|
| Assignees |
|
| Reporter |
arsenm
|
This is to address this [fixme](https://github.com/llvm/llvm-project/blob/8f182526de1ac3def68272feb24870297f2b46f3/llvm/test/Transforms/Attributor/nofpclass.ll#L3664) in a test.
```
define float @assume_returned_arg(float %arg) {
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: write)
; CHECK-LABEL: define float @assume_returned_arg
; CHECK-SAME: (float returned [[ARG:%.*]]) #[[ATTR19]] {
; CHECK-NEXT: [[ORD:%.*]] = fcmp ord float [[ARG]], 0.000000e+00
; CHECK-NEXT: call void @llvm.assume(i1 noundef [[ORD]]) #[[ATTR22]]
; CHECK-NEXT: ret float [[ARG]]
;
%ord = fcmp ord float %arg, 0.0
call void @llvm.assume(i1 %ord)
ret float %arg
}
```
opt -S -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs does not introduce nofpclass on the return attribute. It should be able to infer that the return value cannot be a nan due to the assume
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs