This is an archive of the discontinued LLVM Phabricator instance.

[AVX-512] Add patterns for matching KANDN using immAllOnesV. Remove patterns that tried to match a -1 constant created by 'not' with a vXi1 type.
ClosedPublic

Authored by craig.topper on Oct 30 2016, 11:53 PM.

Details

Summary

Looks like 'not' in patterns doesn't work properly for vector types and ends up creating a patterns that look for a single immediate with a vector type. This can't really occur.

This patch replaces all uses of 'not' on vectors with 'null_frag' and then adds patterns for KANDN. We already had the patterns for KNOT and KXNOR.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper retitled this revision from to [AVX-512] Add patterns for matching KANDN using immAllOnesV. Remove patterns that tried to match a -1 constant created by 'not' with a vXi1 type..
craig.topper updated this object.
craig.topper added reviewers: delena, igorb.
craig.topper added a subscriber: llvm-commits.
igorb edited edge metadata.Nov 1 2016, 7:18 AM

Hello Craig,
You are correct, 'not' node is incorrect in this case , but i think we can use 'vnot' . It generate correct patterns

 // Src: (xor:v8i1 VK8:v8i1:$src, (build_vector:v8i1)<<P:Predicate_immAllOnesV>>) - Complexity = 7
// Dst: (KNOTBrr:v8i1 VK8:v8i1:$src)

Thanks! Does this mean we can also remove the KXNOR patterns that seemed to be working around this already?

craig.topper edited edge metadata.

Use vnot instead of not for vXi1 vectors as Igor suggested.

igorb added a comment.Nov 2 2016, 12:10 AM

Thanks! Does this mean we can also remove the KXNOR patterns that seemed to be working around this already?

I think so.

igorb accepted this revision.Nov 2 2016, 12:15 AM
igorb edited edge metadata.

Thanks for looking into this.

LGTM

This revision is now accepted and ready to land.Nov 2 2016, 12:15 AM
This revision was automatically updated to reflect the committed changes.