This is an archive of the discontinued LLVM Phabricator instance.

[GlobalOpt] Remove heap SROA
ClosedPublic

Authored by MaskRay on May 11 2021, 10:24 AM.

Details

Summary

GlobalOpt implements a heap SROA (SROA for an malloc allocatated struct or array
of structs) which is largely undertested (heap-sra-[1234].ll are basically the
same test with very little difference) and does not trigger at all when
bootstrapping clang (it only supports the case of one single store).

The heap SROA implementation causes PR50027 (GEP is not properly handled; crash or miscompile).
Just drop the implementation. I have deleted some obviously duplicated tests
but kept heap-sra-[12]{,-no-nullopt}.ll.

Diff Detail

Event Timeline

MaskRay created this revision.May 11 2021, 10:24 AM
MaskRay requested review of this revision.May 11 2021, 10:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 11 2021, 10:24 AM
MaskRay updated this revision to Diff 344470.May 11 2021, 10:32 AM

Delete more dead code

seems fine, small nits

llvm/lib/Transforms/IPO/GlobalOpt.cpp
1015–1026

these could still be used to get to OptimizeGlobalAddressOfMalloc, why are these being deleted?

if you are deleting the Phi part, PHIs is no longer used

MaskRay edited the summary of this revision. (Show Details)May 11 2021, 10:50 AM
MaskRay updated this revision to Diff 344484.May 11 2021, 10:50 AM

Delete PHIS - unused after removal of heap SROA.

This revision is now accepted and ready to land.May 11 2021, 11:07 AM
MaskRay updated this revision to Diff 344509.May 11 2021, 11:34 AM

Fix the case of the function name while updating its signature.

This revision was landed with ongoing or failed builds.May 11 2021, 11:34 AM
This revision was automatically updated to reflect the committed changes.
llvm/test/Transforms/GlobalOpt/heap-sra-3-no-null-opt.ll