This is an archive of the discontinued LLVM Phabricator instance.

[Hexagon] Use 'not' instead of 'vnot' in patterns with vectors.
ClosedPublic

Authored by craig.topper on Apr 16 2021, 2:28 PM.

Details

Summary

'not' expands to checking for an xor with a -1 constant. Since
this looks for a ConstantSDNode it will never match for a vector.

'vnot' expands to immAllOnesV.

It doesn't look like there is any coverage for these instructions
since no test failed. I even tried removing some of the patterns
completely in case I was wrong about -1 not working and still
nothing failed.

Diff Detail

Event Timeline

craig.topper created this revision.Apr 16 2021, 2:28 PM
craig.topper requested review of this revision.Apr 16 2021, 2:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 16 2021, 2:28 PM

I'd have to take a closer look at this. You're right that these patterns won't match in this form, but the fixes may need to be different. The standard treatment of boolean vectors as somewhat equivalent to n-bit integers or having immediate value doesn't work well with Hexagon, so we have nodes like HexagonPTRUE or HexagonQTRUE (and the corresponding falses).

Thanks for doing this, btw!

I'd have to take a closer look at this. You're right that these patterns won't match in this form, but the fixes may need to be different. The standard treatment of boolean vectors as somewhat equivalent to n-bit integers or having immediate value doesn't work well with Hexagon, so we have nodes like HexagonPTRUE or HexagonQTRUE (and the corresponding falses).

Thanks for doing this, btw!

I'm happy to let you take this over. I did the best I knew how.

This revision was not accepted when it landed; it landed in state Needs Review.Apr 22 2021, 1:37 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.