[PATCH] D32782: Add pthread_self function prototype and make it speculatable.

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 2 22:13:43 PDT 2017


davide added inline comments.


================
Comment at: lib/Analysis/TargetLibraryInfo.cpp:1182-1184
+  case LibFunc_pthread_self:
+    return NumParams == 0 && FTy.getReturnType()->isIntegerTy();
+
----------------
I'm not entirely sure about this bit.
IIRC POSIX specifies thread ids to be opaque, see:

```
       Thread identifiers should be considered opaque: any attempt to use a
       thread ID other than in pthreads calls is nonportable and can lead to
       unspecified results.
```

so this assumption of it being an integer type might not hold.


https://reviews.llvm.org/D32782





More information about the llvm-commits mailing list