This is an archive of the discontinued LLVM Phabricator instance.

[LoopIdiom] Basic OptimizationRemarkEmitter handling
ClosedPublic

Authored by lebedev.ri on May 29 2019, 2:40 PM.

Details

Summary

I'm adding ORE to memset/memcpy formation, with tests,
but mainly this is split off from D61144.

Diff Detail

Repository
rL LLVM

Event Timeline

lebedev.ri created this revision.

Actually generate check lines

thegameg added inline comments.May 29 2019, 2:53 PM
lib/Transforms/Scalar/LoopIdiomRecognize.cpp
980 ↗(On Diff #202062)

Can we make the function name an argument of the remark? Something like (haven't tried to see if it actually works):

ORE.emit([&]() {
    return OptimizationRemark(DEBUG_TYPE, "ProcessLoopStridedStore",
                              NewCall->getDebugLoc(), Preheader)
           << "Transformed loop-strided store into a call to "
            << ore::NV(NewCall->getCalledFunction()) << "() function";
  });

And I guess the same applies to the other remark.

This way, the diagnostic will still show up in the same way but the serialized version will have the function (with its debug loc if available) as a separate argument.

lebedev.ri marked an inline comment as done.

Use ore::NV() to report the newly called function

thegameg accepted this revision.May 29 2019, 3:18 PM

LGTM, thanks!

This revision is now accepted and ready to land.May 29 2019, 3:18 PM

LGTM, thanks!

Hm, that was fast, thank you for the review!
I'll land this tomorrow.

This revision was automatically updated to reflect the committed changes.