OSDN Git Service

[X86] Don't create i64 constants on 32-bit targets when lowering v64i1 constant build...
authorCraig Topper <craig.topper@intel.com>
Fri, 15 Sep 2017 17:09:03 +0000 (17:09 +0000)
committerCraig Topper <craig.topper@intel.com>
Fri, 15 Sep 2017 17:09:03 +0000 (17:09 +0000)
commitdca8ff7a7db082ae58cd54ea53b53b8a6c5e3334
treefec039416fd6412e54a4e3f3b3f7e22937e994b7
parent566eb704ab3e2684c28f1de3b951e5a6d142a410
[X86] Don't create i64 constants on 32-bit targets when lowering v64i1 constant build vectors

When handling a v64i1 build vector of constants on 32-bit targets we were creating an illegal i64 constant that we then bitcasted back to v64i1. We need to instead create two 32-bit constants, bitcast them to v32i1 and concat the result. We should also take care to handle the halves being all zeros/ones after the split.

This patch splits the build vector and then recursively lowers the two pieces. This allows us to handle the all ones and all zeros cases with minimal effort. Ideally we'd just do the split and concat, and let lowering get called again on the new nodes, but getNode has special handling for CONCAT_VECTORS that reassembles the pieces back into a single BUILD_VECTOR. Hopefully the two temporary BUILD_VECTORS we had to create to do this that don't get returned don't cause any issues.

Fixes PR34605.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313366 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/pr34605.ll [new file with mode: 0644]