Page MenuHomePhabricator

[InstCombine] Move the checks for pointer types in getMaskedTypeForICmpPair earlier in the function

Authored by craig.topper on Aug 9 2017, 4:59 PM.



I don't think there's any reason to have them scattered about and on all 4 operands. We already have an early check that both compares must be the same type. And within a given compare the LHS and RHS must have the same type. Beyond that I don't think there's anyway this function returns anything valid for pointer types. So let's just return early and be done with it.

Diff Detail


Event Timeline

craig.topper created this revision.Aug 9 2017, 4:59 PM
davide accepted this revision.Aug 21 2017, 12:51 PM

This is a decent cleanup. Feel free to submit without pre-commit review when it's obvious they're correct (and they're NFC).

This revision is now accepted and ready to land.Aug 21 2017, 12:51 PM
This revision was automatically updated to reflect the committed changes.