[PATCH] D53892: [CodeGen] Support custom format of stack maps

Artur Pilipenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 12 15:32:10 PST 2018


apilipenko added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/AsmPrinter.cpp:3005-3007
+      if (MP->emitStackMaps(SM, *this))
+        // We've emitted a custom format, done.
+        return;
----------------
reames wrote:
> cherry wrote:
> > apilipenko wrote:
> > > I'm not sure that early termination is the right thing to do. There might be more than one GC strategy in use in the current module, and all of them might want to emit stack maps.
> > In theory there could be more than one GC strategies, although I couldn't see how it can be used.
> > 
> > What about changing it to running all the GCMetadataPrinters, then return if any of the emitStackMaps returns true?
> > 
> The structure of the existing code is that a single model can contain functions compiled with two different gc strategies.  I agree it's a bit odd, but it should continue to work.
> 
> I'd also like to move towards being able to emit *multiple* formats for a single GC.  (Primarily for testing purposes.)  That can be out of scope for your change if you desire.  
You can make the value returned from emitStackMaps indicate whether the default stackmap is needed. You would print the default format (`SM.serializeToStackMapSection `) if at least one of the MPs requested default format serialization.

If a strategy doesn't have a MP than by default it requests default serialization printing. 


https://reviews.llvm.org/D53892





More information about the llvm-commits mailing list