[PATCH] D120000: [1/2] TLS loads opimization (hoist)

Xiang Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 1 22:39:28 PST 2022


xiangzhangllvm added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/TLSVariableHoist.cpp:198
+
+  BasicBlock *PreHeader = L->getLoopPredecessor();
+
----------------
craig.topper wrote:
> Predecessor and PreHeader aren't quite the same thing. A PreHeader also has the loop as it's only successor.
Sorry, not much clear about it.
My understand is the PreHeader here not in loop (currently it is the outermost loop), so if here has  PreHeader for the loop, we can directly insert the bitcast instruction in  PreHeader. 
Because the PreHeader must dominate the Loop (It is the only way to go to Loop).


```
PreHeader
    |
    V
   Loop
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120000



More information about the llvm-commits mailing list