[PATCH] D46992: [AMDGPU] Add perf hints to functions

Tony Tye via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 16 21:31:30 PDT 2018


t-tye added inline comments.


================
Comment at: lib/Target/AMDGPU/AMDGPUPerfHint.cpp:289
+  }
+  FIM[&F] = FI;
+}
----------------
Should this be done at the beginning of the visit to ensure will terminate for mutual recursive functions?


================
Comment at: lib/Target/AMDGPU/AMDGPUPerfHint.cpp:388
+  if (isLocalAddr(MO))
+      return MAI;
+
----------------
indentation


================
Comment at: lib/Target/AMDGPU/AMDGPUPerfHint.cpp:392
+  MAI.Base = llvm::GetPointerBaseWithConstantOffset(MO, MAI.Offset, *DL);
+  return std::move(MAI);
+}
----------------
Does having the std::move() prevent named return value optimization (which can happen for the return above)? Returning a prvalue (eg by directly returning a constructor) would get guaranteed copy elision in C++17. 


https://reviews.llvm.org/D46992





More information about the llvm-commits mailing list