[PATCH] D150367: [AIX][TLS] Generate optimized local-exec access code sequence using X-Form loads/stores

Amy Kwan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 30 08:59:54 PDT 2023


amyk marked 2 inline comments as done.
amyk added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:787
+bool PPCDAGToDAGISel::tryTLSXFormStore(StoreSDNode *ST) {
+  SDValue Base = ST->getBasePtr();
+  if (!canOptimizeTLSDFormToXForm(CurDAG, Base))
----------------
lei wrote:
> Since `Base` is only used on line 788, consider just inlining it there vs defining a new variable.
Actually, `Base` is also used here below:
```
SDValue Ops[] = {ST->getValue(), Base.getOperand(0), Base.getOperand(1),
                   Chain};
```


================
Comment at: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:836
   SDValue Base = LD->getBasePtr();
-  if (Base.getOpcode() != PPCISD::ADD_TLS)
-    return false;
-  SDValue Offset = LD->getOffset();
-  if (!Offset.isUndef())
-    return false;
-  if (Base.getOperand(1).getOpcode() == PPCISD::TLS_LOCAL_EXEC_MAT_ADDR)
+  if (!canOptimizeTLSDFormToXForm(CurDAG, Base))
     return false;
----------------
lei wrote:
> Since `Base` only used here, can inline and remove declaration.
Actually, `Base` is also used here below, right?
```
  SDValue Ops[] = {Base.getOperand(0), Base.getOperand(1), Chain};
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150367



More information about the llvm-commits mailing list