This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add more XVentanaCondOps patterns.
ClosedPublic

Authored by craig.topper on Dec 20 2022, 10:54 AM.

Details

Summary

Add patterns with seteq/setne conditions.

We don't have instructions for seteq/setne except for comparing
with zero and need to emit an ADDI or XOR before a seqz/snez to
compare other values.

The select ISD node takes a 0/1 value for the condition, but the
VT_MASKC(N) instructions check all XLen bits for zero or non-zero.
We can use this to avoid the seqz/snez in many cases.

This is pretty ridiculous number of patterns. I wonder if we could
use some ComplexPatterns to merge them, but I'd like to do that as
a follow up and focus on correctness of the result in this patch.

Diff Detail

Event Timeline

craig.topper created this revision.Dec 20 2022, 10:54 AM
craig.topper requested review of this revision.Dec 20 2022, 10:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 20 2022, 10:54 AM
craig.topper retitled this revision from [RISCV] Add more XVentanCondOps patterns. to [RISCV] Add more XVentanaCondOps patterns..Dec 20 2022, 11:00 PM
craig.topper edited the summary of this revision. (Show Details)Jan 5 2023, 11:14 AM

Ping

reames accepted this revision.Jan 6 2023, 7:42 AM

LGTM

This revision is now accepted and ready to land.Jan 6 2023, 7:42 AM
This revision was automatically updated to reflect the committed changes.