1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
llvm-mirror/test/CodeGen
James Molloy 50628c2e20 [Thumb] Teach ISel how to lower compares of AND bitmasks efficiently
For the common pattern (CMPZ (AND x, #bitmask), #0), we can do some more efficient instruction selection if the bitmask is one consecutive sequence of set bits (32 - clz(bm) - ctz(bm) == popcount(bm)).

1) If the bitmask touches the LSB, then we can remove all the upper bits and set the flags by doing one LSLS.
2) If the bitmask touches the MSB, then we can remove all the lower bits and set the flags with one LSRS.
3) If the bitmask has popcount == 1 (only one set bit), we can shift that bit into the sign bit with one LSLS and change the condition query from NE/EQ to MI/PL (we could also implement this by shifting into the carry bit and branching on BCC/BCS).
4) Otherwise, we can emit a sequence of LSLS+LSRS to remove the upper and lower zero bits of the mask.

1-3 require only one 16-bit instruction and can elide the CMP. 4 requires two 16-bit instructions but can elide the CMP and doesn't require materializing a complex immediate, so is also a win.

llvm-svn: 281323
2016-09-13 12:12:32 +00:00
..
AArch64 GlobalISel: support translation of global addresses. 2016-09-12 12:10:41 +00:00
AMDGPU AMDGPU: Do not clobber SCC in SIWholeQuadMode 2016-09-12 16:25:20 +00:00
ARM [Thumb] Teach ISel how to lower compares of AND bitmasks efficiently 2016-09-13 12:12:32 +00:00
BPF
Generic
Hexagon Revert of r281304 as it is causing build bot failures in hexagon 2016-09-13 08:51:59 +00:00
Inputs
Lanai
Mips
MIR [AArch64] Support stackmap/patchpoint in getInstSizeInBytes 2016-09-13 07:45:17 +00:00
MSP430
NVPTX DebugInfo: New metadata representation for global variables. 2016-09-13 01:12:59 +00:00
PowerPC Remove MVT:i1 xor instruction before SELECT. (Performance improvement). 2016-09-13 09:12:45 +00:00
SPARC
SystemZ
Thumb [Thumb] Teach ISel how to lower compares of AND bitmasks efficiently 2016-09-13 12:12:32 +00:00
Thumb2 [Thumb] Teach ISel how to lower compares of AND bitmasks efficiently 2016-09-13 12:12:32 +00:00
WebAssembly [WebAssembly] Trying to fix broken tests in CodeGen/WebAssembly caused by r281285. 2016-09-13 10:05:44 +00:00
WinEH
X86 Remove MVT:i1 xor instruction before SELECT. (Performance improvement). 2016-09-13 09:12:45 +00:00
XCore