fabs and fneg share a common transformation:
(fneg (bitconvert x)) -> (bitconvert (xor x sign)) (fabs (bitconvert x)) -> (bitconvert (and x ~sign))
This patch separate the code into a single method.
Paths
| Differential D86862
[NFC] [DAGCombiner] Refactor bitcast folding within fabs/fneg ClosedPublic Authored by qiucf on Aug 31 2020, 12:56 AM.
Details Summary fabs and fneg share a common transformation: (fneg (bitconvert x)) -> (bitconvert (xor x sign)) (fabs (bitconvert x)) -> (bitconvert (and x ~sign)) This patch separate the code into a single method.
Diff Detail
Event Timeline
qiucf marked 3 inline comments as done. Comment ActionsAddress style comments.
Comment Actions LGTM
This revision is now accepted and ready to land.Aug 31 2020, 7:11 AM Closed by commit rG5475154865fd: [NFC] [DAGCombiner] Refactor bitcast folding within fabs/fneg (authored by qiucf). · Explain WhyAug 31 2020, 9:49 AM This revision was automatically updated to reflect the committed changes. qiucf marked an inline comment as done.
Revision Contents
Diff 288969 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
|
By the way, this can be removed since getNegatedExpression above already handles it?