Issue 97427
Summary SimplifyDemandedBits should handle fneg/fabs/fcopysign
Labels good first issue, floating-point, llvm:SelectionDAG
Assignees
Reporter arsenm
    fneg, fabs and fcopysign are defined as bit operations, and should be subject to bitwise simplification. Fneg is xor with a signbit mask, fabs is and with a sign mask, and fcopysign is and signbit mask, and inverted signbit mask, and or.

This would allow deleting [more specific optimizations in visitFCOPYSIGN](https://github.com/llvm/llvm-project/blob/5ee53d417f41e8f452255ded1ff6a522afe17f08/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp#L17552) 

This was brought up in https://github.com/llvm/llvm-project/pull/97180#discussion_r1660844076_

Attaching starter patch to point where this needs to go:
[0001-TODO-Support-FABS-FCOPYSIGN-FNEG-in-SimplifyDemanded.patch](https://github.com/user-attachments/files/16070829/0001-TODO-Support-FABS-FCOPYSIGN-FNEG-in-SimplifyDemanded.patch)

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to