This is an archive of the discontinued LLVM Phabricator instance.

[X86] Remove SDIVREM8_SEXT_HREG/UDIVREM8_ZEXT_HREG and their associated DAG combine and target bits support. Use a post isel peephole instead.
ClosedPublic

Authored by craig.topper on Oct 19 2018, 12:42 PM.

Details

Summary

These nodes exist to overcome an isel problem where we can generate a zero extend of an AH register followed by an extract subreg, and another zero extend. The first zero extend exists to avoid a partial register update copying the AH register into the low 8-bits. The second zero extend exists if the user wanted the remainder zero extended.

To make this work we had a DAG combine to morph the DIVREM opcode to a special opcode that included the extend. But then we had to add the new node to computeKnownBits and computeNumSignBits to process the extension portion.

This patch instead removes all of that and adds a late peephole to detect the two extends.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Oct 19 2018, 12:42 PM
RKSimon added inline comments.Oct 20 2018, 1:50 PM
lib/Target/X86/X86ISelDAGToDAG.cpp
887 ↗(On Diff #170240)

This comment probably needs changing.....

Move comment.

This revision is now accepted and ready to land.Oct 21 2018, 10:34 AM
This revision was automatically updated to reflect the committed changes.