[PATCH] D48606: [X86] Use bts/btr/btc for single bit set/clear/complement of a variable bit position

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 27 00:49:12 PDT 2018


lebedev.ri added a comment.

In https://reviews.llvm.org/D48606#1144491, @craig.topper wrote:

> The 16-bit BTR fails to match because the 'and' got promoted to 32-bit and the rotate didn't. We need to fix the promotion of the rotate. I don't think we should try to pattern match the bit width mismatch. In reality, C type promotion rules make it likely the IR for an "unsigned short" case is already in i32 before we even get to the backend so its probably not a huge issue. So I don't think that should hold up this patch. I'm happy to add a FIXME and/or file a bug.


Oh right, https://godbolt.org/g/qsd6aF, only the last case isn't folded if i try it locally.


https://reviews.llvm.org/D48606





More information about the llvm-commits mailing list