[PATCH] D117912: [IR] document and update ctlz/cttz intrinsics to optionally return poison rather than undef

Piotr Zielinski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 22 10:17:51 PST 2022


zielaj added a comment.

@craig.topper Yes, it does <https://godbolt.org/z/jebcn5frP>, when compiled for  example with `-march=skylake`. But when compiled with `-march=x86-64`, which I guess is a default for many linux distributions, it compiles <https://godbolt.org/z/oYhnYKE6G> to conditional jumps rather than conditional moves, even with `__builtin_unpredictable`, which is slow in our case.

On top of this, a widely used version of GCC (11.2), inserts conditional jumps <https://godbolt.org/z/boWorah9n> even with `-march=skylake` (the trunk version of GCC has this fixed).

So, in this case, it's difficult to guarantee optimum generated code case across compilers and architectures.


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

https://reviews.llvm.org/D117912



More information about the llvm-commits mailing list