This is an archive of the discontinued LLVM Phabricator instance.

[X86] Post process the DAG after isel to remove vector moves that were added to zero upper bits.
ClosedPublic

Authored by craig.topper on Mar 8 2018, 11:51 PM.

Details

Summary

We currently avoid inserting these moves during isel in a few cases which is implemented using a whitelist of opcodes. But it's too difficult to generate a perfect list of opcodes to whitelist. Especially with AVX512F without AVX512VL using 512 bit vectors to implement some 128/256 bit operations. Since isel is done bottoms up, we'd have to check the VT and opcode and subtarget in order to determine whether an EXTRACT_SUBREG would be generated for some operations.

So instead of doing that, this patch adds a post processing step that detects when the moves are unnecesssary after isel. At that point any EXTRACT_SUBREGs would have already been created and appear in the DAG. So then we just need to ensure the input to the move isn't one.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Mar 8 2018, 11:51 PM
RKSimon accepted this revision.Mar 16 2018, 8:39 AM

LGTM

This revision is now accepted and ready to land.Mar 16 2018, 8:39 AM
This revision was automatically updated to reflect the committed changes.