This is an archive of the discontinued LLVM Phabricator instance.

[DSE] Use precise loc for memcpy_chk during overwrite checks.
ClosedPublic

Authored by fhahn on Dec 1 2022, 4:11 AM.

Details

Summary

Extends the logic from D115167 to memcpy_chk.

Depends on D115167

Diff Detail

Event Timeline

fhahn created this revision.Dec 1 2022, 4:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 1 2022, 4:11 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
fhahn requested review of this revision.Dec 1 2022, 4:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 1 2022, 4:11 AM
asbirlea accepted this revision.Dec 1 2022, 9:57 AM
asbirlea added inline comments.
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
886–887

nit: will this be further extended to need the switch? or include in the if ( ... && (F == LibFunc_memset_chk || F == LibFunc_memcpy_chk))?

This revision is now accepted and ready to land.Dec 1 2022, 9:57 AM
fhahn retitled this revision from [DSE] Use precise loc for memset_chk during overwrite checks. to [DSE] Use precise loc for memcpy_chk during overwrite checks..Dec 2 2022, 5:11 AM
fhahn updated this revision to Diff 479613.Dec 2 2022, 6:21 AM

Thanks! Update to use if and rebase, I am planning to land this soon.

fhahn marked an inline comment as done.Dec 2 2022, 6:24 AM
fhahn added inline comments.
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
886–887

I think memset_chk and memcpy_chk are the main ones, so I updated the code to use an if instead of switch. We can use a switch if more cases are added, thanks!

This revision was landed with ongoing or failed builds.Dec 2 2022, 6:34 AM
This revision was automatically updated to reflect the committed changes.
fhahn marked an inline comment as done.