In expansion of FCOPYSIGN, the shift node is missing when the two operands of FCOPYSIGN are of the same size. We should always generate shift node (if the required shift bit is not zero) to put the sign bit into the right position, regardless of the size of underlying types.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
LGTM, nice catch!
- In the future please submit patches with full context to ease review (see https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface)
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | ||
---|---|---|
1492–1496 | How about using this pattern here (functionality is the same): EVT ShiftVT = IntVT; if (SignBit.getValueSizeInBits() < ClearedSign.getValueSizeInBits()) { SignBit = DAG.getNode(ISD::ZERO_EXTEND, DL, MagVT, SignBit); ShiftVT = MagVT; } |
How about using this pattern here (functionality is the same):