[PATCH] D135488: [codegen] Add a remarks based Stack Layout Analysis pass

Paul Kirth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 11 10:48:32 PST 2023


paulkirth added a comment.

@thegameg I think I finally understood what you meant re: multi-line remarks. Sorry for the back/forth on that, it just didn't click for me until you commented on the screenshot.

BTW, is there a way to nest some of the items? Ideally we'd be able to have a `Slot` in the YAML that contains all the various data, similar to how `DebugLoc` is a more complex object with fields for `File`, `Line`, and `Column`. That way we could group all the data for each slot including variable locations.

I know how that would look in YAML, but I'm unaware of how we'd do that with the existing remarks interfaces... or if doing so would massively change the CLI output. any pointers here?



================
Comment at: llvm/lib/CodeGen/StackFrameLayoutAnalysisPass.cpp:55
+    Variable,       // a Slot used to store a local data (could be a tmp)
+    Error           // Its an error for a slot to have this type
+  };
----------------
thegameg wrote:
> 
Good catch! TY


================
Comment at: llvm/lib/CodeGen/StackFrameLayoutAnalysisPass.cpp:110
+
+  std::string genStackOffsetPrefix(int I) const {
+    // Negative offsets will print a leading `-`, so only add `+`
----------------
thegameg wrote:
> Is this still worth being a separate function?
yeah, probably not 


================
Comment at: llvm/lib/CodeGen/StackFrameLayoutAnalysisPass.cpp:128
+
+  void emitLayoutRemark(const MachineFunction &MF, StringRef RemarkName,
+                        StringRef RemarkLabel, StringRef Data,
----------------
thegameg wrote:
> Unused?
Yeah, looks like I forgot to remove this. Thanks


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135488



More information about the cfe-commits mailing list