This is an archive of the discontinued LLVM Phabricator instance.

[InstCombineAddSub] Transformation for the expression (X | Y) - X --> (~X & Y)
ClosedPublic

Authored by ankur29.garg on Oct 15 2014, 1:52 AM.

Details

Summary

Hi,
The following changes implement the transformation for the expression - (X | Y) - X --> (~X & Y).

Z3 Link: http://rise4fun.com/Z3/2D4n

Please help in reviewing it.

Thanks.

Diff Detail

Repository
rL LLVM

Event Timeline

ankur29.garg retitled this revision from to [InstCombineAddSub] Transformation for the expression (X | Y) - X --> (~X & Y).
ankur29.garg updated this object.
ankur29.garg edited the test plan for this revision. (Show Details)
ankur29.garg set the repository for this revision to rL LLVM.
ankur29.garg added a subscriber: Unknown Object (MLST).
majnemer accepted this revision.Oct 26 2014, 1:37 PM
majnemer edited edge metadata.

LGTM

This revision is now accepted and ready to land.Oct 26 2014, 1:37 PM
majnemer requested changes to this revision.Oct 26 2014, 2:34 PM
majnemer edited edge metadata.

Actually, I think this needs a small tweak.

lib/Transforms/InstCombine/InstCombineAddSub.cpp
1643–1648 ↗(On Diff #14914)

Please move your change so it is near this pattern.

This revision now requires changes to proceed.Oct 26 2014, 2:34 PM
ankur29.garg edited edge metadata.

Moved the transformation to the location suggested.

ankur29.garg edited edge metadata.

Added the test case. Forgot to include it in the last revision.

majnemer accepted this revision.Nov 2 2014, 9:44 PM
majnemer edited edge metadata.

LGTM

This revision is now accepted and ready to land.Nov 2 2014, 9:44 PM

Thank you David, for reviewing the patch. Can you also please commit this, as I don't have commit access yet.

Thanks.

majnemer added inline comments.Nov 2 2014, 9:53 PM
test/Transforms/InstCombine/sub.ll
544–548 ↗(On Diff #15683)

I don't believe you have run the tests after updating your patch, please do so in the future.

majnemer closed this revision.Nov 2 2014, 10:04 PM
majnemer updated this revision to Diff 15684.

Closed by commit rL221129 (authored by @majnemer).