[PATCH] D55305: [RISCV] Add lowering of global TLS addresses

Lewis Revill via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 20 05:56:50 PDT 2019


lewis-revill added inline comments.


================
Comment at: lib/Target/RISCV/RISCVISelLowering.cpp:468
+      0);
+  return SDValue(DAG.getMachineNode(RISCV::ADDI, DL, Ty, MNAdd, AddrLo), 0);
+}
----------------
lewis-revill wrote:
> Am I correct in thinking this sequence should actually be opaque here, it causes a DAG with multiple load/stores of the same GlobalTLSAddress to only duplicate the `ADDI` relative to a single `AddTPRel` node... I know this would be safe for absolute addressing, but not for thread-pointer relative addressing?
Actually it appears GCC will do common subexpression elimination on this sequence with optimizations enabled so I would take that to mean it is safe to emit as it is.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D55305





More information about the llvm-commits mailing list