This is an archive of the discontinued LLVM Phabricator instance.

Do not specialize IRBuilder to strip names in SROA
ClosedPublic

Authored by mehdi_amini on Mar 9 2016, 6:23 PM.

Details

Summary

Following r263086, we are replacing this by a runtime check.
More cleanup will follow on the IRBuilder itself, but I submitted
this patch separately as SROA has a fancy "prefixInserter" class
that needs extra-love.

Diff Detail

Event Timeline

mehdi_amini updated this revision to Diff 50222.Mar 9 2016, 6:23 PM
mehdi_amini retitled this revision from to Do not specialize IRBuilder to strip names in SROA.
mehdi_amini updated this object.
mehdi_amini added a reviewer: chandlerc.
mehdi_amini added a subscriber: llvm-commits.
chandlerc edited edge metadata.Mar 10 2016, 1:52 AM

FYI i've been reviewing these and I'll LGTM them as soon as we're clearly on the same page with Philip in D17946's thread.

chandlerc accepted this revision.Mar 11 2016, 12:52 AM
chandlerc edited edge metadata.

LGTM patch is fine, but also see comment below.

lib/Transforms/Scalar/SROA.cpp
93–104

When you measured, did you measure getting rid of this complexity too?

If it doesn't slow SROA down when the context has the flag set, I would be all in favor of just completely removing the NDEBUG hacking here. My expectation is that the overhead of this while not zero (it uses an actual std::string) is *very* close to zero.

That said, if you'd rather submit as-is, I can take care of cleaning this up.

This revision is now accepted and ready to land.Mar 11 2016, 12:52 AM
mehdi_amini edited edge metadata.

Remove NDEBUG ifdef in IRBuilderPrefixedInserter