[PATCH] D136728: [PowerPC] Add handling for WACC register spilling.

Stefan Pintilie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 3 19:07:28 PDT 2022


stefanp added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1301
+  if (ReportAccMoves) {
+    dbgs() << "Emitting wacc register " << (IsRestore ? "restore" : "spill")
+           << ":\n";
----------------
amyk wrote:
> Realized I had a question about this and just wanted to confirm - but the reason we are using `dbgs()` instead of the usual `LLVM_DEBUG(dbgs())` is because of the `#ifdef NDEBUG`, right? Meaning in the cases where we're using the macro, we shouldn't be doing it the `LLVM_DEBUG()` way?
Yes that's correct.
Here is how `LLVM_DEBUG` is defined.
```
  #ifdef NDEBUG
  #define LLVM_DEBUG(X)
  #else
  #define LLVM_DEBUG(X) do { if (DebugFlag) { X; } } while (0)
  #endif
```
The idea is that if we have `NDEBUG` defined then `LLVM_DEBUG` is defined as doing nothing. If we use `#ifdef NDEBUG` directly in code then we know that in the else case the code will be executed in debug mode and it doesn't need to be guarded with `LLVM_DEBUG` because it is already in the else case of the `NDEBUG`. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136728



More information about the llvm-commits mailing list