This is an archive of the discontinued LLVM Phabricator instance.

Added InstCombine transform for pattern " ((X % Y) % Y) -> (X % Y) ".
ClosedPublic

Authored by sonamkumari on Sep 15 2014, 3:31 AM.

Details

Summary

Hi All,

This patch implements transform for the pattern " ((X % Y) % Y) -> (X % Y) "

Please help in reviewing the same.

Thanks,
Sonam.

Diff Detail

Repository
rL LLVM

Event Timeline

sonamkumari retitled this revision from to Added InstCombine transform for pattern " ((X % Y) % Y) -> (X % Y) "..
sonamkumari updated this object.
sonamkumari edited the test plan for this revision. (Show Details)
sonamkumari set the repository for this revision to rL LLVM.
sonamkumari added a subscriber: Unknown Object (MLST).
majnemer edited edge metadata.Sep 15 2014, 9:53 AM

This doesn't introduce any new instructions, move it to InstSimplify.

sonamkumari edited edge metadata.

Hi David,

Thanks for your review comments.
I have made the changes as per your comments and resubmitted the patch.
Kindly review it. :)

Regards,
Sonam.

majnemer added inline comments.Sep 15 2014, 9:14 PM
lib/Analysis/InstructionSimplify.cpp
1174 ↗(On Diff #13736)

This can just be:
if (match(Op0, m_SRem(m_Value(), m_Specific(Op1)))) {

Hi David,

Resubmitted the patch based on your comments.
Kindly review it. :)

Regards,
Sonam.

majnemer accepted this revision.Sep 16 2014, 7:31 PM
majnemer edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Sep 16 2014, 7:31 PM

Hi David,

Thanks for your consistent time and support. :)
Can you please commit this patch.

Regards,
Sonam.

majnemer closed this revision.Sep 16 2014, 8:44 PM
majnemer updated this revision to Diff 13768.

Closed by commit rL217937 (authored by @majnemer).