[PATCH] D42646: [X86] Avoid using high register trick for test instruction

Amaury SECHET via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 08:27:32 PST 2018


deadalnix created this revision.
deadalnix added reviewers: craig.topper, niravd, spatel, hfinkel.

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 .


Repository:
  rL LLVM

https://reviews.llvm.org/D42646

Files:
  lib/Target/X86/X86ISelDAGToDAG.cpp
  test/CodeGen/X86/test-shrink.ll
  test/CodeGen/X86/testb-je-fusion.ll
  test/CodeGen/X86/vastart-defs-eflags.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42646.131809.patch
Type: text/x-patch
Size: 5966 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180129/edefa327/attachment.bin>


More information about the llvm-commits mailing list