This is an archive of the discontinued LLVM Phabricator instance.

[SeparateConstOffsetFromGEP] Fix an illegitimate optimization on zext
ClosedPublic

Authored by jingyue on Jun 7 2014, 10:47 AM.

Details

Reviewers
eliben
meheff
Summary

zext(a + b) != zext(a) + zext(b) even if a + b >= 0 && b >= 0.

e.g., a = i4 0b1111, b = i4 0b0001
zext a + b to i8 = zext 0b0000 to i8 = 0b00000000
(zext a to i8) + (zext b to i8) = 0b00001111 + 0b00000001 = 0b00010000

Diff Detail

Event Timeline

jingyue updated this revision to Diff 10206.Jun 7 2014, 10:47 AM
jingyue retitled this revision from to [SeparateConstOffsetFromGEP] Fix an illegitimate optimization on zext.
jingyue updated this object.
jingyue edited the test plan for this revision. (Show Details)
jingyue added reviewers: eliben, meheff.
jingyue added a subscriber: Unknown Object (MLST).
meheff accepted this revision.Jun 8 2014, 10:17 AM
meheff edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jun 8 2014, 10:17 AM
jingyue closed this revision.Jun 8 2014, 1:27 PM

Committed in r210439