<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64867>64867</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Attributor not propagating nofpclass arguments through transitive caller
</td>
</tr>
<tr>
<th>Labels</th>
<td>
ipo,
missed-optimization
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
arsenm
</td>
</tr>
</table>
<pre>
```
define amdgpu_kernel void @math_kernel(ptr addrspace(1) nocapture noundef writeonly align 4 %out, ptr addrspace(1) nocapture noundef readonly align 4 %in1, ptr addrspace(1) nocapture noundef readonly align 4 %in2) #0 {
entry:
%call = tail call i64 @_Z13get_global_idj(i32 noundef 0) #2
%sext = shl i64 %call, 32
%idxprom = ashr exact i64 %sext, 32
%arrayidx = getelementptr inbounds float, ptr addrspace(1) %in1, i64 %idxprom
%i = load float, ptr addrspace(1) %arrayidx, align 4
%arrayidx2 = getelementptr inbounds float, ptr addrspace(1) %in2, i64 %idxprom
%i1 = load float, ptr addrspace(1) %arrayidx2, align 4
%call3 = tail call reassoc nnan ninf nsz arcp afn nofpclass(nan inf) float @_Z3powff(float noundef nofpclass(nan inf) %i, float noundef nofpclass(nan inf) %i1) #2
%arrayidx5 = getelementptr inbounds float, ptr addrspace(1) %out, i64 %idxprom
store float %call3, ptr addrspace(1) %arrayidx5, align 4
ret void
}
define internal float @_Z3powff(float noundef %arg, float noundef %arg1) #1 {
bb:
%i = tail call float @__ocml_pow_f32(float noundef %arg, float noundef %arg1) #2
ret float %i
}
define internal float @__ocml_pow_f32(float noundef %arg, float noundef %arg1) #1 {
bb:
%implement.pow = call float asm " ; do pow $0, $1, $2", "=v,v,v"(float %arg, float %arg1)
ret float %implement.pow
}
declare i64 @_Z13get_global_idj(i32 noundef)
attributes #0 = { convergent mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { convergent mustprogress nofree norecurse nounwind willreturn memory(none) }
attributes #2 = { convergent nounwind willreturn memory(none) }
```
opt -S -p=attributor gives this result:
```
define internal float @_Z3powff(float noundef nofpclass(nan inf) %arg, float noundef nofpclass(nan inf) %arg1) #1 {
bb:
%i = tail call float @__ocml_pow_f32(float noundef %arg, float noundef %arg1) #3
ret float %i
}
define internal float @__ocml_pow_f32(float noundef %arg, float noundef %arg1) #1 {
bb:
%implement.pow = call float asm " ; do pow $0, $1, $2", "=v,v,v"(float %arg, float %arg1)
ret float %implement.pow
}
```
nofpclass(nan inf) is correctly set on _Z3powff, but didn't make it all the way to __ocml_pow_f32
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUV81yozoTfRp505UUCIzthReZceUFvt23cQnUYM0IiWo1djxPf0uAQ36c3GQyVffeqgQDaZ1z-qi7FasQTOMQt2L5TSx3C9XzwdNWUUDXLkqvz1tRJNNPshPJncbaOATV6qbr9z-RHFo4eqNB5Emr-DC9E3LdMYHSmkKnKhRynQq5Aecr1XFPCM73TmMNJzKM3tkzKGsaBzkIufQ9C_kdPghBqPRLBOPSLyPIGCxkloBYfRvzR8d0Ftnd-BTDKmUtiGwHrIyF4ckUebRj__80a5D3jfWlsnujfwi5Npl8ZE0mfDmhRbiADzzAhcMENFLEZJ4FGv3QkW-HWBUOBPigKr4siTCvligidTb6YVjTIKPFFh1Hj4wro6gAtfXqbe9nYyeeScVTXQO69Ur_PdZFUIyZnL8iV35Rr3xfb_obguV1xXGjshfFQKhC8BU4pxw442pw4RcoqjpQtQPn666yKgQh1zHCuDpyDUrGIso6f6prIdfju0vxvLEwZhTFfTg4fVGET7Jcfsn4qYevGx_YE16ynIz7iPHL18YT8jCBxkex2k03T-eVcYzklP2ArwNZ89rC8f3FrXQeCWU5z4O5AeYCmCn3vmrtvvOnfZ3J3yR-7OeY9qN_5pPJ_wkl71nQdmPF3Hb-NNjxxAkVWhAyNvU30B6GCJknkU7IPJ0-pZByvJUi2x2F_D79znJfypzlXffoqag3_KqsIvzo_H4kGq-K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