This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Use move semantics in ScalarEvolution::setRange
ClosedPublic

Authored by craig.topper on May 6 2017, 9:32 AM.

Details

Summary

This makes setRange take ConstantRange by value since most callers were passing an unnamed temporary ConstantRange. We can then move that ConstantRange into the DenseMap caches. For the callers that weren't passing a temporary, I've added std::move to to the local variable being passed.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.May 6 2017, 9:32 AM
sanjoy accepted this revision.May 6 2017, 11:01 AM

lgtm!

This revision is now accepted and ready to land.May 6 2017, 11:01 AM
takuto.ikuta added inline comments.
include/llvm/Analysis/ScalarEvolution.h
785 ↗(On Diff #98069)

Better to change type to ConstantRange&&?

This revision was automatically updated to reflect the committed changes.