[llvm] Handle #dbg_values in SROA. (PR #94070)

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 14 14:00:11 PDT 2024


================
@@ -80,6 +80,23 @@ TinyPtrVector<DbgVariableRecord *> llvm::findDVRDeclares(Value *V) {
   return Declares;
 }
 
+TinyPtrVector<DbgVariableRecord *> llvm::findDVRValues(Value *V) {
+  // This function is hot. Check whether the value has any metadata to avoid a
+  // DenseMap lookup.
+  if (!V->isUsedByMetadata())
----------------
adrian-prantl wrote:

How expensive is this check then? Is that a field lookup, a DenseMap lookup, ...? Might be worth commenting that here.

https://github.com/llvm/llvm-project/pull/94070


More information about the llvm-commits mailing list