OSDN Git Service

[X86] Avoid using high register trick for test instruction
authorAmaury Sechet <deadalnix@gmail.com>
Mon, 29 Jan 2018 20:54:33 +0000 (20:54 +0000)
committerAmaury Sechet <deadalnix@gmail.com>
Mon, 29 Jan 2018 20:54:33 +0000 (20:54 +0000)
commitf8d1af0489461409a332399ccd11c0fd64b860d6
tree937874d47f8bcbbd69da52c9d175a09e77c4fd58
parentbf6c8a51e4046d4660c4e9c6a723b1583289996e
[X86] Avoid using high register trick for test instruction

Summary:
It seems it's main effect is to create addition copies when values are inr register that do not support this trick, which increase register pressure and makes the code bigger.

The main noteworthy regression I was able to observe was pattern of the type (setcc (trunc (and X, C)), 0) where C is such as it would benefit from the hi register trick. To prevent this, a new pattern is added to materialize such pattern using a 32 bits test. This has the added benefit of working with any constant that is materializable as a 32bits immediate, not just the ones that can leverage the high register trick, as demonstrated by the test case in test-shrink.ll using the constant 2049 .

Reviewers: craig.topper, niravd, spatel, hfinkel

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323690 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelDAGToDAG.cpp
lib/Target/X86/X86InstrArithmetic.td
lib/Target/X86/X86InstrInfo.cpp
lib/Target/X86/X86MacroFusion.cpp
test/CodeGen/X86/test-shrink.ll
test/CodeGen/X86/testb-je-fusion.ll
test/CodeGen/X86/vastart-defs-eflags.ll