llvm-project/llvm/test/CodeGen
Akira Hatanaka 22e839f4b2 [AArch64] Improve code generation for logical instructions taking
immediate operands.

This commit adds an AArch64 dag-combine that optimizes code generation
for logical instructions taking immediate operands. The optimization
uses demanded bits to change a logical instruction's immediate operand
so that the immediate can be folded into the immediate field of the
instruction.

This recommits r300932 and r300930, which was causing dag-combine to
loop forever. The problem was that optimizeLogicalImm was returning
true even when there was no change to the immediate node (which happened
when the immediate was all zeros or ones), which caused dag-combine to
push and pop the same node to the work list over and over again without
making any progress.

This commit fixes the bug by returning false early in optimizeLogicalImm
if the immediate is all zeros or ones. Also, it changes the code to
compare the immediate with 0 or Mask rather than calling
countPopulation.

rdar://problem/18231627

Differential Revision: https://reviews.llvm.org/D5591

llvm-svn: 301019
2017-04-21 18:53:12 +00:00
..
AArch64 [AArch64] Improve code generation for logical instructions taking 2017-04-21 18:53:12 +00:00
AMDGPU CodeGen: Let frame index value type match alloca addr space 2017-04-20 18:15:34 +00:00
ARM ARM: don't try to create an i8 -> i32 vpaddl. 2017-04-21 17:21:59 +00:00
AVR [AVR] Remove the 'multibyte' asm test 2017-04-19 12:13:45 +00:00
BPF [bpf] Fix memory offset check for loads and stores 2017-04-13 22:24:13 +00:00
Generic [Hexagon] Unxfail passing tests 2017-04-13 16:05:35 +00:00
Hexagon [Hexagon] Generate proper offset in opt-addr-mode 2017-04-19 15:15:51 +00:00
Inputs
Lanai
MIR MIR: Allow parsing of empty machine functions 2017-04-11 19:32:41 +00:00
MSP430 In visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled. 2017-03-14 00:34:14 +00:00
Mips [mips][msa] Mask vectors holding shift amounts 2017-04-20 13:26:46 +00:00
NVPTX Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00
PowerPC [DAG] add splat vector support for 'xor' in SimplifyDemandedBits 2017-04-19 21:23:09 +00:00
SPARC [Sparc] Check register use with isPhysRegUsed() instead of reg_nodbg_empty() 2017-03-08 15:23:10 +00:00
SystemZ Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00
Thumb [Thumb1] The recently added tADCS and tSBCS pseudo-instructions were missing `Uses = [CPSR]` 2017-04-21 07:35:21 +00:00
Thumb2 Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00
WebAssembly [WebAssembly] Fix WebAssemblyOptimizeReturned after r300367 2017-04-17 21:40:28 +00:00
WinEH
X86 [ConstHoisting] Add BFI in constanthoisting pass and select the best insertion 2017-04-21 15:50:16 +00:00
XCore In visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled. 2017-03-14 00:34:14 +00:00