[PATCH] D12271: [X86] Expose the various _rot intrinsics on non-MS platforms

Sean Silva via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 24 23:01:11 PDT 2015


silvas added a subscriber: silvas.
silvas added a comment.

In http://reviews.llvm.org/D12271#231204, @rnk wrote:

> This looks good.
>
> As a larger issue, LLVM fast isel definitely won't pattern match this series of shifts and selects to rotl at -O0. There are some users who want branchless constant time rotates regardless of optimization level (https://llvm.org/bugs/show_bug.cgi?id=24226). My thinking is that the shifts are more analyzable to LLVM than an intrinsic, so we should leave these intrinsics alone and tell such users to use inline asm if they need these kinds of low-level guarantees. It still isn't very satisfactory. =/


I don't remember anything in PR24226 about "regardless of optimization level". In particular, code with "constant time" requirements won't tolerate -O0 codegen anyway because of the large amount of memory accesses into the stack -- the timing of such operations will depend on nasty things like cache line aliasing and such, which has similar problems to branches.


http://reviews.llvm.org/D12271





More information about the cfe-commits mailing list