aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2019-07-15 23:07:56 +0000
committerCraig Topper <craig.topper@intel.com>2019-07-15 23:07:56 +0000
commit51193871dafd99e79d7d19f62cffbdcdda238530 (patch)
treee5690d055ecc0679b2841c93c3c87334017a8322 /llvm/lib/CodeGen/MachineBasicBlock.cpp
parentc48162db994ab6040c45d468ea95772b574ab3ef (diff)
downloadllvm-51193871dafd99e79d7d19f62cffbdcdda238530.zip
llvm-51193871dafd99e79d7d19f62cffbdcdda238530.tar.gz
llvm-51193871dafd99e79d7d19f62cffbdcdda238530.tar.bz2
[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
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
0 files changed, 0 insertions, 0 deletions