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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 26 14:16:15 PDT 2018


craig.topper updated this revision to Diff 152961.
craig.topper added a comment.

Added the 16-bit test. The 16-bit btr pattern on x86-64 fails to match because the 'and' got promoted to i32 but the rotate didn't. The btc/bts test promoted everything to i32 so we just use the i32 pattern.

The i686 tests fail to select the new pattern because the parameters came off the stack and we still prioritize load folding over these new patterns. In larger sections of real world code where the data didn't directly come from a load we should manage to fold. I can try to add more tests that pad have a preamble of other operations to separate from the load if we want.


https://reviews.llvm.org/D48606

Files:
  lib/Target/X86/X86InstrCompiler.td
  test/CodeGen/X86/btc_bts_btr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48606.152961.patch
Type: text/x-patch
Size: 13236 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180626/b3b533d7/attachment.bin>


More information about the llvm-commits mailing list