[PATCH] D76828: [RISC-V] Support __builtin_thread_pointer

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 26 07:01:00 PDT 2020


asb added a comment.

Thanks for the patch. I added a couple of nits - please rename the test file to thread-pointer.ll to match what other backends do and make it more discoverable. Also, although there different is minor we do use `update_llc_test_checks.py` for essentially all RISC-V tests so it would be good to use that for thread-pointer.ll as well.



================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:841
+  unsigned IntNo = cast<ConstantSDNode>(Op.getOperand(0))->getZExtValue();
+  SDLoc dl(Op);
+  switch (IntNo) {
----------------
Nit: Should be `DL` to match the variable naming elsewhere.


================
Comment at: llvm/test/CodeGen/RISCV/pr45303.ll:1
+; RUN: llc < %s -mtriple=riscv64-unknown-linux | FileCheck %s --check-prefix=CHECK
+; RUN: llc < %s -mtriple=riscv32-unknown-linux | FileCheck %s --check-prefix=CHECK
----------------
We normally put the smallest triple that make sense. In this case, just `riscv32` and `riscv64` are sufficient to exhibit the bheaviour.


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

https://reviews.llvm.org/D76828





More information about the llvm-commits mailing list