This is an archive of the discontinued LLVM Phabricator instance.

[AVX-512] Handle kor/kand/kandn/kxor/kxnor/knot intrinsics at lowering time instead of isel
ClosedPublic

Authored by craig.topper on Mar 16 2017, 2:53 PM.

Details

Summary

Currently we handle these intrinsics at isel with special patterns. But as they just map to normal logic operations, we should just handle them at lowering. This will expose them to DAG combine optimizations. Right now the kor-sequence test generates a bunch of regclass copies between GR16 and VK16 that the peephole optimizer and/or register coallescing are removing to keep everything in the mask domain. By handling the logic op intrinsics earlier, these copies become bitcasts in the DAG and get removed by DAG combine which seems more robust.

This should help enable my plan to stop copying between K registers and GR8/GR16. The peephole optimizer can't remove a chain of copies between K and GR32 with insert_subreg/extract_subreg present in the chain so the kor-sequence test break. But this patch should dodge the problem entirely.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Mar 16 2017, 2:53 PM
igorb accepted this revision.Mar 19 2017, 1:14 AM

LGTM

This revision is now accepted and ready to land.Mar 19 2017, 1:14 AM
This revision was automatically updated to reflect the committed changes.