[PATCH] D26930: Teach optimizer that pthread_self does not trap. It can be speculatively executed.
Hal Finkel via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 21 15:43:49 PST 2016
hfinkel added a comment.
In https://reviews.llvm.org/D26930#601972, @trentxintong wrote:
> I, too, hope readnone+nounwind functions can be speculatively executed, but it does not seem to be the case =). Thats why i think we need to use TLI to teach the optimizer about functions which can.
In https://reviews.llvm.org/D26930#601971, @joerg wrote:
> Your example is UB.
You're both right. We cannot speculate functions that might have UB. Thus, we cannot speculate general external functions (even if they're readnone, etc.). See also: https://reviews.llvm.org/D20116 where we're discussing adding a separate attribute for this.
Repository:
rL LLVM
https://reviews.llvm.org/D26930
More information about the llvm-commits
mailing list