[PATCH] D46992: [AMDGPU] Add perf hints to functions
Valery Pykhtin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 25 03:51:51 PDT 2018
vpykhtin added a comment.
LGTM. Just a hint: whenever you use "auto X = ..." it's worth to specify explicitly if X is pointer or reference. It's not only saves you from accidental temp object by copy but also makes program easier to read.
================
Comment at: lib/Target/AMDGPU/SIMachineFunctionInfo.cpp:178
+
+ if (auto Resolver = MF.getMMI().getResolver()) {
+ if (AMDGPUPerfHintAnalysis *PHA = static_cast<AMDGPUPerfHintAnalysis*>(
----------------
I would use "auto &Resolver" to emphasize Resolver is a reference not a temp object
https://reviews.llvm.org/D46992
More information about the llvm-commits
mailing list