[PATCH] D19569: [Mips] Add support for llvm.thread.pointer intrinsic.
Marcin KoĆcielnicki via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 27 10:27:46 PDT 2016
This revision was automatically updated to reflect the committed changes.
koriakin marked 2 inline comments as done.
Closed by commit rL267743: [Mips] Add support for llvm.thread.pointer intrinsic. (authored by koriakin).
Changed prior to commit:
http://reviews.llvm.org/D19569?vs=55120&id=55256#toc
Repository:
rL LLVM
http://reviews.llvm.org/D19569
Files:
llvm/trunk/lib/Target/Mips/MipsSEISelLowering.cpp
llvm/trunk/test/CodeGen/Mips/thread-pointer.ll
Index: llvm/trunk/test/CodeGen/Mips/thread-pointer.ll
===================================================================
--- llvm/trunk/test/CodeGen/Mips/thread-pointer.ll
+++ llvm/trunk/test/CodeGen/Mips/thread-pointer.ll
@@ -0,0 +1,12 @@
+; RUN: llc -march=mips < %s | FileCheck %s
+; RUN: llc -march=mips64 < %s | FileCheck %s
+; RUN: llc -march=mipsel < %s | FileCheck %s
+; RUN: llc -march=mips64el < %s | FileCheck %s
+
+declare i8* @llvm.thread.pointer() nounwind readnone
+
+define i8* @thread_pointer() {
+; CHECK: rdhwr $3, $29
+ %1 = tail call i8* @llvm.thread.pointer()
+ ret i8* %1
+}
Index: llvm/trunk/lib/Target/Mips/MipsSEISelLowering.cpp
===================================================================
--- llvm/trunk/lib/Target/Mips/MipsSEISelLowering.cpp
+++ llvm/trunk/lib/Target/Mips/MipsSEISelLowering.cpp
@@ -2166,6 +2166,10 @@
case Intrinsic::mips_xori_b:
return DAG.getNode(ISD::XOR, DL, Op->getValueType(0),
Op->getOperand(1), lowerMSASplatImm(Op, 2, DAG));
+ case Intrinsic::thread_pointer: {
+ EVT PtrVT = getPointerTy(DAG.getDataLayout());
+ return DAG.getNode(MipsISD::ThreadPointer, DL, PtrVT);
+ }
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19569.55256.patch
Type: text/x-patch
Size: 1186 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160427/db924d75/attachment.bin>
More information about the llvm-commits
mailing list