spatel added a comment. About the bit hacking: I don't think clang should be in the optimization business. We should be able to take the most obvious/simple representation for this builtin and reduce it as needed (either in instcombine or the backend). So it would be better to use the version with the subtract rather than shift/or. That version corresponds more directly to the code in APInt::getMinSignedBits()?
================ Comment at: include/clang/Basic/Builtins.def:416 BUILTIN(__builtin_popcountll, "iULLi", "nc") +BUILTIN(__builtin_clrsb , "ii" , "nc") +BUILTIN(__builtin_clrsbl , "iLi" , "nc") ---------------- Is is intentional that clang doesn't document the behavior of the builtins that it copies from gcc? I'd think logic descriptions for all of these would be handy, but especially for less common ones like 'clrsb'. https://reviews.llvm.org/D50168 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits