llvm-project/llvm/test/CodeGen
Craig Topper 51193871da [X86] Teach convertToThreeAddress to handle SUB with immediate
We mostly avoid sub with immediate but there are a couple cases that can create them. One is the add 128, %rax -> sub -128, %rax trick in isel. The other is when a SUB immediate gets created for a compare where both the flags and the subtract value is used. If we are unable to linearize the SelectionDAG to satisfy the flag user and the sub result user from the same instruction, we will clone the sub immediate for the two uses. The one that produces flags will eventually become a compare. The other will have its flag output dead, and could then be considered for LEA creation.

I added additional test cases to add.ll to show the the sub -128 trick gets converted to LEA and a case where we don't need to convert it.

This showed up in the current codegen for PR42571.

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

llvm-svn: 366151
2019-07-15 23:07:56 +00:00
..
AArch64 [test][AArch64] Relax the opcode tests for FP min/max instructions. 2019-07-12 21:39:45 +00:00
AMDGPU [AMDGPU] Enable merging m0 initializations. 2019-07-15 22:07:05 +00:00
ARC [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
ARM [ARM] Adjust how NEON shifts are lowered 2019-07-15 10:44:50 +00:00
AVR [AVR] Fix tests after r363757 2019-07-04 06:12:47 +00:00
BPF [BPF] add unit tests for preserve_{array,union,struct}_access_index intrinsics 2019-07-15 04:51:34 +00:00
Generic Revert "r364412 [ExpandMemCmp][MergeICmps] Move passes out of CodeGen into opt pipeline." 2019-06-26 12:13:13 +00:00
Hexagon [Hexagon] Custom-lower UADDO(x, 1) and USUBO(x, 1) 2019-07-01 15:50:09 +00:00
Inputs
Lanai [SDAG] commute setcc operands to match a subtract 2019-07-10 23:23:54 +00:00
MIR AMDGPU: Serialize mode from MachineFunctionInfo 2019-07-10 16:09:26 +00:00
MSP430 [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
Mips [mips] Fix JmpLink to texternalsym and tglobaladdr on mcroMIPS R6 2019-07-12 04:58:45 +00:00
NVPTX [NVPTX] Use atomicrmw fadd instead of intrinsics 2019-07-11 17:11:25 +00:00
PowerPC [PowerPC] Support fp128 libcalls 2019-07-15 05:02:32 +00:00
RISCV [RISCV] Fix ICE in isDesirableToCommuteWithShift 2019-07-09 16:24:16 +00:00
SPARC [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
SystemZ [SystemZ] Fix addcarry of addcarry of const carry (PR42606) 2019-07-12 20:03:34 +00:00
Thumb [ARM] Favour PL/MI over GE/LT when possible 2019-07-04 08:58:58 +00:00
Thumb2 [ARM] MVE vector for 64bit types 2019-07-15 18:42:54 +00:00
WebAssembly [WebAssembly] Add missing utility methods for exnref type 2019-07-15 23:04:00 +00:00
WinCFGuard
WinEH [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
X86 [X86] Teach convertToThreeAddress to handle SUB with immediate 2019-07-15 23:07:56 +00:00
XCore [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00