diff options
author | Craig Topper <craig.topper@intel.com> | 2019-10-01 23:18:31 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2019-10-01 23:18:31 +0000 |
commit | 8c19925f42901db51dbbf3e3a7b1a789cd2bc646 (patch) | |
tree | e6cf702d619f350ea8c5627ec43e6bb4a3d67148 /llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp | |
parent | a82d2fe94427f3122ecf94549b5f7f4c57b7b913 (diff) | |
download | llvm-8c19925f42901db51dbbf3e3a7b1a789cd2bc646.zip llvm-8c19925f42901db51dbbf3e3a7b1a789cd2bc646.tar.gz llvm-8c19925f42901db51dbbf3e3a7b1a789cd2bc646.tar.bz2 |
[X86] Add a DAG combine to shrink vXi64 gather/scatter indices that are constant with sufficient sign bits to fit in vXi32
The gather/scatter instructions can implicitly sign extend the indices. If we're operating on 32-bit data, an v16i64 index can force a v16i32 gather to be split in two since the index needs 2 registers. If we can shrink the index to the i32 we can avoid the split. It should always be safe to shrink the index regardless of the number of elements. We have gather/scatter instructions that can use v2i32 index stored in a v4i32 register with v2i64 data size.
I've limited this to before legalize types to avoid creating a v2i32 after type legalization. We could check for it, but we'd also need testing. I'm also only handling build_vectors with no bitcasts to be sure the truncate will constant fold.
Differential Revision: https://reviews.llvm.org/D68247
llvm-svn: 373408
Diffstat (limited to 'llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp')
0 files changed, 0 insertions, 0 deletions