This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] add assert and explanatory comment for fold removed in r279568; NFC
ClosedPublic

Authored by spatel on Aug 23 2016, 3:39 PM.

Details

Summary

I deleted a fold from InstCombine at:
https://reviews.llvm.org/rL279568

because it (like any InstCombine to a constant?) should always happen in InstSimplify, however, it's not obvious what the assumptions are in the remaining code.

Add a comment and assert to make it clearer.

Diff Detail

Repository
rL LLVM

Event Timeline

spatel updated this revision to Diff 69047.Aug 23 2016, 3:39 PM
spatel retitled this revision from to [InstCombine] add assert and explanatory comment for fold removed in r279568; NFC.
spatel updated this object.
spatel added a reviewer: eli.friedman.
spatel added a subscriber: llvm-commits.
spatel updated this revision to Diff 69052.Aug 23 2016, 3:52 PM

I think I missed an important set of parens in the previous draft, but got no warning from clang.

efriedma accepted this revision.Aug 23 2016, 4:09 PM
efriedma added a reviewer: efriedma.
efriedma added a subscriber: efriedma.

I don't think the parentheses actually matter here; "(x || y) && true" is equivalent to "x || (y && true)".

LGTM.

This revision is now accepted and ready to land.Aug 23 2016, 4:09 PM
This revision was automatically updated to reflect the committed changes.