Page MenuHomePhabricator

[SimplifyLibCalls][NFC] Clean up LibCallSimplifier from 'memset + malloc into calloc' transformation
ClosedPublic

Authored by yurai007 on Jun 1 2021, 4:58 AM.

Details

Summary

FoldMallocMemset can be safely removed because since https://reviews.llvm.org/D103009
such transformation is already performed in DSE.

Diff Detail

Event Timeline

yurai007 created this revision.Jun 1 2021, 4:58 AM
yurai007 requested review of this revision.Jun 1 2021, 4:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2021, 4:58 AM

TODO: rebase when D103009 is delivered.

nikic added inline comments.Jun 9 2021, 1:42 PM
llvm/test/Transforms/DeadStoreElimination/noop-stores.ll
350 ↗(On Diff #349246)

Better include this in the other change.

llvm/test/Transforms/InstCombine/memset-1.ll
32

You can leave the tests here and add a comment that this pattern is now handled by DSE in a more general way.

yurai007 updated this revision to Diff 357451.Jul 9 2021, 2:37 AM

Rebased and addressed comments.

yurai007 marked 2 inline comments as done.Jul 9 2021, 2:39 AM
yurai007 retitled this revision from [SimplifyLibCalls][NFC] Clean up LibCallSimplifier from memset+malloc into calloc transformation to [SimplifyLibCalls][NFC] Clean up LibCallSimplifier from 'memset + malloc into calloc' transformation.
yurai007 edited the summary of this revision. (Show Details)

@nikic: Kindly ping, all comments were addressed.

This revision is now accepted and ready to land.Aug 4 2021, 11:59 AM

Can we cherry pick this to release-13.0/12 too since it also has the change that made the removed code in this patch obsolete in the first place?