| Issue |
177932
|
| Summary |
InstCombine should SimplifyDemandedBits on copysign sign operand
|
| Labels |
llvm:instcombine,
floating-point
|
| Assignees |
|
| Reporter |
arsenm
|
https://alive2.llvm.org/ce/z/griQ26
```
define float @src(float %mag, float %sign) {
%sign.int = bitcast float %sign to i32
%and.sign = and i32 %sign.int, -2147483648
%cast.sign = bitcast i32 %and.sign to float
%result = call float @llvm.copysign.f32(float %mag, float %cast.sign)
ret float %result
}
```
This should fold to just a copysign. We use SimplifyDemandedBits on the sign operand in SelectionDAG, but InstCombine does not. Part of my effort to optimize the implementations of pow and related functions
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs