[PATCH] D47452: [NFC][X86][AArch64] Add some more IR tests for BZHI instruction

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 28 08:11:08 PDT 2018


lebedev.ri created this revision.
Herald added a reviewer: javed.absar.
Herald added a subscriber: kristof.beyls.

In https://reviews.llvm.org/D47428, i propose to choose the `~(-(1 << nbits))` as the canonical form of low-bit-mask formation.
As it is seen from these tests, there is a reason for that.

AArch64 currently better handles `~(-(1 << nbits))`, but not the more traditional `(1 << nbits) - 1` (sic!).
The other way around for X86.
It would be much better to canonicalize.

It would seem that there is too much tests, but this is most of all the auto-generated possible variants
of C code that one would expect for BZHI to be formed, and then manually cleaned up a bit.
So this should be pretty representable, which somewhat good coverage...

Related links:
https://bugs.llvm.org/show_bug.cgi?id=36419
https://bugs.llvm.org/show_bug.cgi?id=37603
https://bugs.llvm.org/show_bug.cgi?id=37610
https://rise4fun.com/Alive/idM


Repository:
  rL LLVM

https://reviews.llvm.org/D47452

Files:
  test/CodeGen/AArch64/get-lowbits.ll
  test/CodeGen/AArch64/set-lowbits-mask.ll
  test/CodeGen/X86/get-lowbits.ll
  test/CodeGen/X86/set-lowbits-mask.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47452.148817.patch
Type: text/x-patch
Size: 83342 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180528/34ed7b40/attachment.bin>


More information about the llvm-commits mailing list