This is an archive of the discontinued LLVM Phabricator instance.

[TargetLowering][RISCV] Allow truncation when checking if the arguments of a setcc are splats.
ClosedPublic

Authored by craig.topper on Apr 6 2022, 2:27 PM.

Details

Summary

We're just trying to canonicalize here and won't be using the constant
value returned.

The attached test changes are because we were previously commuting
a seteq X, (splat_vector 0) because we also have (sub 0, X). The
0 is larger than the element type so we don't detect it as a splat
without the AllowTruncation flag. By preventing the commute we are
able to match it to the vmseq.vx instruction during isel. We only
look for constants on the RHS in isel.

Diff Detail

Event Timeline

craig.topper created this revision.Apr 6 2022, 2:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2022, 2:27 PM
craig.topper requested review of this revision.Apr 6 2022, 2:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2022, 2:27 PM
craig.topper retitled this revision from [TargetLowering][RISCV] Allow truncation if the arguments of a setcc are splats. to [TargetLowering][RISCV] Allow truncation when checking if the arguments of a setcc are splats..Apr 6 2022, 2:34 PM
spatel accepted this revision.Apr 11 2022, 9:01 AM

I don't know enough to comment on the test diffs, but the code change LGTM.

This revision is now accepted and ready to land.Apr 11 2022, 9:01 AM
This revision was landed with ongoing or failed builds.Apr 11 2022, 9:50 AM
This revision was automatically updated to reflect the committed changes.