[PATCH] D157673: [PowerPC] Support local-dynamic TLS relocation on AIX

Kai Luo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 13 20:08:49 PDT 2023


lkail added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCTLSDynamicCall.cpp:163
+              MI.getOpcode() == PPC::TLSLDAIX) {
+            // For Local-Dynamic
+            auto &Subtarget = MBB.getParent()->getSubtarget<PPCSubtarget>();
----------------
Add comment to describe code sequence of `local-dynamic`.


================
Comment at: llvm/lib/Target/PowerPC/PPCTLSDynamicCall.cpp:164
+            // For Local-Dynamic
+            auto &Subtarget = MBB.getParent()->getSubtarget<PPCSubtarget>();
+            bool IsLargeModel =
----------------
nit: Use complete type identifier rather than `auto &` since the type is simple.


================
Comment at: llvm/lib/Target/PowerPC/PPCTLSDynamicCall.cpp:184
+                            ? ModuleHandleHReg
+                            : Register(Subtarget.getTOCPointerRegister()));
             BuildMI(MBB, I, DL, TII->get(TargetOpcode::COPY), GPR3)
----------------
nit: No need explicitly call `Register(MCRegister)`.


================
Comment at: llvm/lib/Target/PowerPC/PPCTLSDynamicCall.cpp:193
+          } else {
+            // For Global-Dynamic
+            // The variable offset and region handle are copied in r4 and r3.
----------------
Comment should be a complete sentence. Add assertion here to indicate handling of `general-dynamic`.


================
Comment at: llvm/test/CodeGen/PowerPC/aix-tls-gd-double.ll:1
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
 ; RUN: llc  -verify-machineinstrs -mcpu=pwr7 -mattr=-altivec \
----------------
Why is test for general-dynamic changed?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157673



More information about the llvm-commits mailing list