You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[CIR][NFC] Fix bug during fp16 unary op CIRGen (#706)
This PR fixes a bug during the CIRGen of fp16 unary operations. Before
this patch, for the expression `-x` where `x` is a fp16 value, CIRGen
emits the code like the following:
```mlir
%0 = cir.cast float_to_float %x : !cir.f16 -> !cir.float
%1 = cir.cast float_to_float %0 : !cir.float -> !cir.f16
%2 = cir.unary minus %1 : !cir.fp16
```
The expected CIRGen should instead be:
```mlir
%0 = cir.cast float_to_float %x : !cir.f16 -> !cir.float
%1 = cir.unary minus %0 : !cir.float
%2 = cir.cast float_to_float %1 : !cir.float -> !cir.f16
```
This PR fixes this issue.
0 commit comments