]> granicus.if.org Git - llvm/commit
[X86] Rework the logic in LowerBuildVectorv16i8 to make better use of any_extend...
authorCraig Topper <craig.topper@intel.com>
Wed, 26 Jun 2019 20:16:19 +0000 (20:16 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 26 Jun 2019 20:16:19 +0000 (20:16 +0000)
commit355b9a12ae89105da270b99465a7ef24aada8d66
tree2e9edc3a2ce03f00bd455756ef8cdcf214c35e4e
parent02ccfb75c00400cfa053d1e2a4f01cc3b3f5cd0e
[X86] Rework the logic in LowerBuildVectorv16i8 to make better use of any_extend and break false dependencies. Other improvements

This patch rewrites the loop iteration to only visit every other element starting with element 0. And we work on the "even" element and "next" element at the same time. The "First" logic has been moved to the bottom of the loop and doesn't run on every element. I believe it could create dangling nodes previously since we didn't check if we were going to use SCALAR_TO_VECTOR for the first insertion. I got rid of the "First" variable and just do a null check on V which should be equivalent. We also no longer use undef as the starting V for vectors with no zeroes to avoid false dependencies. This matches v8i16.

I've changed all the extends and OR operations to use MVT::i32 since that's what they'll be promoted to anyway. I've tried to use zero_extend only when necessary and use any_extend otherwise. This resulted in some improvements in tests where we are now able to promote aligned (i32 (extload i8)) to a 32-bit load.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364469 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/buildvec-insertvec.ll
test/CodeGen/X86/promote-vec3.ll
test/CodeGen/X86/vector-shuffle-128-v16.ll
test/CodeGen/X86/widen_conv-3.ll