[Comgr][HotSwap] Refactor hotswap related files into their own directory#3274
[Comgr][HotSwap] Refactor hotswap related files into their own directory#3274chinmaydd wants to merge 3 commits into
Conversation
|
Just thinking out aloud here: is raiser vs rewriter the right long term abstraction here? Should we instead split it up into phases, like parse code object, discover kernels, classify source/target ISA, choose transform strategy, run transforms, update metadata/debug info, emit code object. “Rewriter” and “raiser” are execution strategies inside that pipeline, not the pipeline itself. How about something instead like: where and eventually we can get a planning directory which decides what strategy to use for different kernels. |
be08c2b to
65b2339
Compare
The rewriter sources previously inherited C++17 from the amd_comgr target. As a standalone OBJECT library the standard defaulted to the compiler's built-in level: GCC defaults to gnu++17 (so Linux built cleanly), but MSVC defaults to C++14, which fails to compile LLVM's C++17 headers (StringRef.h: 'data' identifier not found, basic_string ctor mismatches). Set CMAKE_CXX_STANDARD 17 in the rewriter CMakeLists, mirroring the raiser. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thanks for engaging. There's a couple of ways one can think about this. The "transforms" framing makes sense if we envision that the raiser can be applied after the rewriter has made a pass-through. This may be relevant for patches or transformations that require a full-program view. However, this is very tricky because as soon as the rewriter has run, one is assuming fixed-placement (relative or otherwise) for certain instructions. When you raise to IR, you are effectively forgoing that. The compiler may choose a different lowering or move things around. Maybe we can have a strict mode that inserts compiler barriers before and after every instruction to prevent that. On the other hand, it may make sense to run the rewriter to run after raiser to take care of some corner cases that may not be fixable though LLVM IR. For this use case, thee raiser needs to support raising and recompiling a specific set of functions. This can be hard for indirect calls, but you can add trampolines to original function addresses to achieve that. We need to clear up the long term vision here. My thought process aligns more towards: Fundamentally, even though the modifications performed by the raiser and the rewriter are "transforms" I think keeping them separate and closely tied to their respective tools makes more sense to me. The raiser is going to operate at an entirely different abstraction i.e LLVM IR whereas the rewriter only looks at machine code (ideally, I would have liked for us to atleast do this at the MCInst layer like BOLT does). |
No description provided.