[llvm] [AIX][TLS] Optimize the small local-exec access sequence for non-zero offsets (PR #71485)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 24 14:59:48 PST 2024


================
@@ -7578,6 +7668,10 @@ void PPCDAGToDAGISel::PeepholePPC64() {
     if (isVSXSwap(SDValue(N, 0)))
       reduceVSXSwap(N, CurDAG);
 
+    // This optimization is performed for non-TOC-based local-exec accesses.
+    if (HasAIXSmallLocalExecTLS)
+      foldADDIForLocalExecAccesses(N, CurDAG);
----------------
diggerlin wrote:

if foldADDIForLocalExecAccesses success only when N->getMachineOpcode() == PPC::ADDI8. and the Opcode of N is not changed in the foldADDIForLocalExecAccesses  , so the OpeCode of N is still ADDI8

it will be `continue` here. 
```
unsigned FirstOp;
    unsigned StorageOpcode = N->getMachineOpcode();
    bool RequiresMod4Offset = false;
 switch (StorageOpcode) {
    default: continue;
```

is it correct ?

https://github.com/llvm/llvm-project/pull/71485


More information about the llvm-commits mailing list