[PATCH] D155600: [AIX][TLS] Produce a faster local-exec access sequence with -maix-small-local-exec-tls (And optimize when load/store offsets are 0)

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 20:50:19 PDT 2023


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:7623
       // other cases provide aligned addresses and are always safe.)
-      if (RequiresMod4Offset &&
+      if (RequiresMod4Offset && !HasAIXSmallLocalExecTLS &&
           (!isa<ConstantSDNode>(Base.getOperand(1)) ||
----------------
This change looks suspicious.

I am getting:
```
Global must be word-aligned for LD, STD, LWA!
UNREACHABLE executed at /terrannew/hstong/.Lpcoral03/llvmbld/dev/llvm-project/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1523!
```

With:
```
clang --target=powerpc64-ibm-aix -maix-small-local-exec-tls -O -c -o /dev/null -xc - \
<<<$'__attribute__((__tls_model__("local-exec"))) __thread struct { int x __attribute__((__packed__)); } a;\nint f() { return a.x; }'
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155600



More information about the llvm-commits mailing list