]> granicus.if.org Git - llvm/commit
[X86] In combineLoopSADPattern, pad result with zeros and use full size add instead...
authorCraig Topper <craig.topper@intel.com>
Wed, 27 Sep 2017 18:36:45 +0000 (18:36 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 27 Sep 2017 18:36:45 +0000 (18:36 +0000)
commit3f855776a669cccc470af03a542136c3b4f1631c
tree4e4c9e7a8cd408f083d142c8e513c961095d8ff7
parent463b87bb2b449d51b3f8c9fe6ccc78bc38596e59
[X86] In combineLoopSADPattern, pad result with zeros and use full size add instead of using a smaller add and inserting.

In some cases the result psadbw is smaller than the type of the add that started the match. Currently in these cases we are using a smaller add and inserting the result.

If we instead combine the psadbw with zeros and use the full size add we can take advantage of implicit zeroing we get if we emit a narrower move before the add.

In a future patch, I want to make isel aware that the psadbw itself already zeroed the upper bits and remove the move entirely.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314331 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/sad.ll