[PATCH] D63547: [AIX]Global Address Lowering

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 1 17:56:12 PDT 2019


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:5075
+    // PowerPC only support small, medium and large code model.
     CodeModel::Model CModel = TM.getCodeModel();
+    assert((CModel != CodeModel::Tiny ||
----------------
This can be made `const`.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:5076
     CodeModel::Model CModel = TM.getCodeModel();
-    if (CModel != CodeModel::Medium && CModel != CodeModel::Large)
+    assert((CModel != CodeModel::Tiny ||
+           CModel != CodeModel::Kernel) &&
----------------
Use English "code model" or code-style `CodeModel`.
Use `clang-format`.
```
    assert((CModel != CodeModel::Tiny || CModel != CodeModel::Kernel) &&
           "PowerPC doesn't support tiny or kernel code models.");
```


================
Comment at: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:5090
+      // Transforms the ISD::TOC_ENTRY node to a PPCISD::LWZtoc.
+      auto replaceWithLWZtoc = [this, dl](SDNode *TocEntry) {
+        SDValue GA = TocEntry->getOperand(0);
----------------
Should `dl` be captured by copy? It seems to be passed by reference to `getMachineNode`. Also, a `SDLoc` holds a `DebugLoc`, and `DebugLoc::hasTrivialDestructor` indicates that the destruction is not always free.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63547





More information about the llvm-commits mailing list