This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Add tests for ssubo X, C -> saddo X, -C
ClosedPublic

Authored by dlrobertson on Mar 21 2019, 10:09 AM.

Details

Diff Detail

Event Timeline

dlrobertson created this revision.Mar 21 2019, 10:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 21 2019, 10:09 AM

It would be good to also have test cases (for the ssubo->saddo canonicalization, not the nsw fold) where the vector constant argument of the ssubo has undef or is non-splat. This is one of those rare cases where we can easily support them, because the necessary machinery is already in place (see https://github.com/llvm-mirror/llvm/blob/master/lib/Transforms/InstCombine/InstCombineCalls.cpp#L2194).

nikic added a comment.Mar 21 2019, 3:03 PM

Additionally we'll also want to test cases where we have i8 -128 on the RHS (with the usual variations, like vector with one element -128 but not others), as we can't do the canonicalization for that case.

It would be good to also have test cases (for the ssubo->saddo canonicalization, not the nsw fold) where the vector constant argument of the ssubo has undef or is non-splat. This is one of those rare cases where we can easily support them, because the necessary machinery is already in place (see https://github.com/llvm-mirror/llvm/blob/master/lib/Transforms/InstCombine/InstCombineCalls.cpp#L2194).

Makes sense.

Additionally we'll also want to test cases where we have i8 -128 on the RHS (with the usual variations, like vector with one element -128 but not others), as we can't do the canonicalization for that case.

Sounds good!

Added test cases

nikic accepted this revision.Mar 24 2019, 1:45 PM

LGTM

This revision is now accepted and ready to land.Mar 24 2019, 1:45 PM
This revision was automatically updated to reflect the committed changes.