This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Relax the checking on AND/AND8 in isSignOrZeroExtended
ClosedPublic

Authored by sfertile on Oct 18 2017, 6:34 PM.

Details

Summary

Separate the handling of AND/AND8 out from PHI/OR/ISEL checking. The reasoning is the others need all their operands to be sign/zero extended for their output to also be sign/zero extended. This is true for AND and sign-extension, but for zero-extension we only need at least one of the input operands to be sign extended for the result to also be zero extended.

Diff Detail

Repository
rL LLVM

Event Timeline

sfertile created this revision.Oct 18 2017, 6:34 PM
nemanjai accepted this revision.Nov 22 2017, 6:47 AM

LGTM.
I think this code may be off by default at this time due to issues on some external benchmarks. If that's the case, it should be fine to commit this, but you'll probably need the flag in the test case to enable the transformation that uses this.

lib/Target/PowerPC/PPCInstrInfo.cpp
2336 ↗(On Diff #119540)

Please turn this into an assert. If we have non-register input operands to a reg+reg instruction, it's an error and we shouldn't just continue.

This revision is now accepted and ready to land.Nov 22 2017, 6:47 AM
inouehrs edited edge metadata.Nov 28 2017, 6:25 AM

I am submitting a patch that may conflict with this change. I expect that it is trivial to resolve the conflict.
https://reviews.llvm.org/D40554

This revision was automatically updated to reflect the committed changes.