[PATCH] D143708: [RISCV] Support emulated TLS

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 2 17:06:29 PST 2023


jrtc27 added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:4655
+
   assert(N->getOffset() == 0 && "unexpected offset in global node");
 
----------------
craig.topper wrote:
> vit9696 wrote:
> > jrtc27 wrote:
> > > Should this assert apply? Given it's true of ELF TLS I'd expect it of emulated TLS too?
> > Is this offset within the TLS space? If so, I am not sure it cannot be 0 for emutls.
> > 
> > I do not have enough knowledge of the codebase to make this decision, and I am reluctant to make a blind change. Can apply if you insist & explain why it should be safe.
> I think it should always be 0 because `RISCVTargetLowering::isOffsetFoldingLegal` returns false.
In fact TargetLowering::LowerToTLSEmulatedModel also asserts this. So yes, safe to hoist it too.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143708



More information about the llvm-commits mailing list