[PATCH] D103651: [AIX] generate eh_info when vector registers are saved according to the traceback table.

Jason Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 7 13:30:07 PDT 2021


jasonliu added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/AsmPrinter.h:755
                               Align InAlign = Align(1));
+  virtual uint16_t getNumberOfVRSaved() const {
+    llvm_unreachable("The function is for aix OS only.");
----------------
I don't feel like this function belong in AsmPrinter.
This function feels more like a PPCFunctionInfo class function. 
Admittedly, doing that means in `AIXException.cpp`, you would need to do an include like this: `#include ../../Target/PowerPC/PPCMachineFunctionInfo.h", which I don't see very often in the llvm source.
Not sure if this is an acceptable practice. @hubert.reinterpretcast  any ideas?

The other way of doing this without that weird include in `AIXException.cpp` would be to move the content in `AIXException.cpp` to `PPCAIXAsmPrinter` instead. That way, you will definitely have access to everything you need in the PPCAIXAsmPrinter context.

Other than that, I am not sure if there is a better way on how to encasuplate what's needed for knowing if the vector register is save. i.e. The fundamental issue here is the knowledge of the PPC vector register is in `lib/Target/PowerPC` directory, so whenever you need to know that knowledge from another directory (and in case, `lib/CodeGen/AsmPrinter/AIXException.cpp`), it's hard to pass the information in. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103651



More information about the llvm-commits mailing list