[PATCH] D55306: [RISCV, WIP] Lower TLS addresses using localexec

James Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 4 19:15:49 PST 2018


jrtc27 requested changes to this revision.
jrtc27 added a comment.
This revision now requires changes to proceed.

The general strategy of adding a pseudo-instruction seems fine; I checked what the Sparc backend does and it defines a `tlsadd` node with its extra `%tie_add(sym)` operand.



================
Comment at: lib/Target/RISCV/RISCVISelLowering.cpp:475
+  // pointer, with the appropriate adjustment for the thread pointer offset.
+  // This generates the pattern (add (add_tprel (lui %tprel_hi(sym)) tp)
+  // %tprel_lo(sym))
----------------
Pattern should be `(add (add_tprel (lui %tprel_hi(sym)) tp %tprel_add(sym)) %tprel_lo(sym))` - you missed the `%tprel_add` operand to `add_tprel`.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D55306





More information about the llvm-commits mailing list