]> granicus.if.org Git - llvm/commit
[AMDGPU] Fix DAGTypeLegalizer::SplitInteger for shift amount type
authorYaxun Liu <Yaxun.Liu@amd.com>
Tue, 21 Nov 2017 02:29:54 +0000 (02:29 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Tue, 21 Nov 2017 02:29:54 +0000 (02:29 +0000)
commit596d1e67f90e6e82acca7d0cba2bc3a27368fe9f
tree57ff5cdd5926fa1f74ae8f64489e639a0463d3de
parent1b39ccedef93e3668d32f030510196bc9ed241c8
[AMDGPU] Fix DAGTypeLegalizer::SplitInteger for shift amount type

DAGTypeLegalizer::SplitInteger uses default pointer size as shift amount constant type,
which causes less performant ISA in amdgcn---amdgiz target since the default pointer
type is i64 whereas the desired shift amount type is i32.

This patch fixes that by using TLI.getScalarShiftAmountTy in DAGTypeLegalizer::SplitInteger.

The X86 change is necessary since splitting i512 requires shifting amount of 256, which
cannot be held by i8.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318727 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
lib/Target/X86/X86ISelLowering.h
test/CodeGen/AMDGPU/insert_vector_elt.v2i16.ll