[PATCH] D140908: [MemProf] Context disambiguation cloning pass [patch 1a/3]

Snehasish Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 21 10:02:04 PDT 2023


snehasish added inline comments.


================
Comment at: llvm/test/Transforms/MemProfContextDisambiguation/inlined2.ll:56
+entry:
+  %call = call noalias noundef nonnull dereferenceable(10) ptr @_Znam(i64 noundef 10) #7, !memprof !7, !callsite !12, !heapallocsite !13
+  ret ptr %call
----------------
tejohnson wrote:
> snehasish wrote:
> > I guess once we reduce the tests, the heapallocsite metadata will be dropped.
> > 
> > On a somewhat related note, should we update the code below (in a separate patch) to drop memprof metadata too?
> > https://github.com/llvm/llvm-project/blob/main/llvm/lib/IR/DebugInfo.cpp#L852
> > 
> > I guess once we reduce the tests, the heapallocsite metadata will be dropped.
> 
> Yeah, I manually removed this metadata from most of the tests, looks like I missed this one. Won't update right now since this will get stripped when I reduce the test cases.
> 
> > On a somewhat related note, should we update the code below (in a separate patch) to drop memprof metadata too?
> 
> Maybe? Unlike the heapallocsite metadata, the memprof metadata doesn't become invalid when the non-line table debug info is removed (it doesn't directly reference it). So it might depend on the intent of this code - do you know when it is invoked? I looked a bit but it wasn't clear to me.
>From the commit message for the pass [1] it looks like the primary usage is to trim bitcode before embedding. The other use case is for bugpoint related reduction which might be useful for us.

> doesn't become invalid

Yes, leaving it in is benign and its very unlikely that a memprof annotated bitcode will end up in a place where this is a concern. Up to you if you want to take any action on this.

[1] https://github.com/llvm/llvm-project/commit/e542804343ac52f40b2310eff4b3f1f045d5e5f4


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140908/new/

https://reviews.llvm.org/D140908



More information about the llvm-commits mailing list