This is an archive of the discontinued LLVM Phabricator instance.

Demo fix for performance-unnecessary-value-param (WIP)
ClosedPublic

Authored by mehdi_amini on Dec 23 2021, 2:22 PM.

Diff Detail

Event Timeline

mehdi_amini created this revision.Dec 23 2021, 2:22 PM
mehdi_amini requested review of this revision.Dec 23 2021, 2:22 PM
Mogball added inline comments.Dec 23 2021, 3:35 PM
mlir/lib/Dialect/StandardOps/IR/Ops.cpp
1166

TypeRangeRange is too large to be passed by value?

mehdi_amini added inline comments.Dec 23 2021, 3:39 PM
mlir/lib/Dialect/StandardOps/IR/Ops.cpp
1166

From the doc:

The check is only applied to parameters of types that are expensive to copy which means they are not trivially copyable or have a non-trivial copy constructor or destructor.

Maybe there is something to fix in the TypeRangeRange class?

Full repo run

Mogball accepted this revision.Dec 29 2021, 9:01 AM
Mogball added inline comments.
mlir/lib/Dialect/StandardOps/IR/Ops.cpp
1166

The class has two std::functions inside of it

This revision is now accepted and ready to land.Dec 29 2021, 9:01 AM
arjunp added inline comments.Dec 29 2021, 9:03 AM
mlir/unittests/Analysis/Presburger/SimplexTest.cpp
97 ↗(On Diff #396476)

Not sure if this should be done in this patch but I guess ArrayRef should be used instead of const SmallVector &.

Apply a few manual fixes, for example const std::function<> & -> llvm::function_ref<>

mehdi_amini marked an inline comment as done.Jan 1 2022, 5:49 PM
This revision was landed with ongoing or failed builds.Jan 1 2022, 5:49 PM
This revision was automatically updated to reflect the committed changes.