[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)
commit3cea36f03e8c0b02c59e00ddcd228669f7437851
treea67bfcb8f728d3a3bc94d09f474789640395a7fe
parent5908affee9a96df72480d7cb963d6412a91556a2
[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

llvm-svn: 318727
llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
llvm/lib/Target/X86/X86ISelLowering.h
llvm/test/CodeGen/AMDGPU/insert_vector_elt.v2i16.ll