OSDN Git Service

[AArch64] Improve code generation for logical instructions taking
authorAkira Hatanaka <ahatanaka@apple.com>
Fri, 21 Apr 2017 00:05:16 +0000 (00:05 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Fri, 21 Apr 2017 00:05:16 +0000 (00:05 +0000)
commit63da689bdf8bed531e187250d250b6b0e30194db
tree63aaf1e85c61b36705a7cd180f80efe126fe8f55
parentdf4849c1dda4bf77ec7123ff5dd55b4f1d055c04
[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 r300913, which broke bots because I didn't fix a call to
ShrinkDemandedConstant in SIISelLowering.cpp after changing the APIs of
TargetLoweringOpt and TargetLowering.

rdar://problem/18231627

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300930 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetLowering.h
lib/CodeGen/SelectionDAG/TargetLowering.cpp
lib/Target/AArch64/AArch64ISelLowering.cpp
lib/Target/AArch64/AArch64ISelLowering.h
lib/Target/AMDGPU/AMDGPUISelLowering.cpp
lib/Target/AMDGPU/SIISelLowering.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/XCore/XCoreISelLowering.cpp
test/CodeGen/AArch64/optimize-imm.ll [new file with mode: 0644]