Codegen of added testcase before this patch:
ptrue p0.s cmpgt p1.s, p0/z, z0.s, z1.s cmpge p2.s, p0/z, z2.s, z1.s and p0.b, p0/z, p1.b, p2.b ret
Patterns originally authored by Will Lovett.
Differential D116749
[AArch64][SVE] Fold predicate into compare Authored by c-rhodes on Jan 6 2022, 8:12 AM.
Details Codegen of added testcase before this patch: ptrue p0.s cmpgt p1.s, p0/z, z0.s, z1.s cmpge p2.s, p0/z, z2.s, z1.s and p0.b, p0/z, p1.b, p2.b ret Patterns originally authored by Will Lovett.
Diff Detail
Event TimelineComment Actions Nice improvement @c-rhodes! Just a couple of suggestions ...
| ||||||||||||||||||
I do wonder if it's also worth creating patterns for ands matching the first operand too, i.e.
def : Pat<(predvt (and (AArch64setcc_z (predvt (AArch64ptrue 31)), intvt:$Op2, intvt:$Op3, cc))), (cmp $Pg, $Op2, $Op3), predvt:$Pg>;I'm thinking about the case where only one input to the and instruction is a setcc, i.e. see my comment about writing other test cases below.