Fix PR3401: when using large integers, the type
authorDuncan Sands <baldrick@free.fr>
Sat, 31 Jan 2009 15:50:11 +0000 (15:50 +0000)
committerDuncan Sands <baldrick@free.fr>
Sat, 31 Jan 2009 15:50:11 +0000 (15:50 +0000)
commit92abc62399881ba9c525be80362c134ad836e2d9
tree596a2370bbd0b6c4279966b6885420abb878ae13
parentd1b5e3fad94d4a5203c0a355aa7d37c01abaca8c
Fix PR3401: when using large integers, the type
returned by getShiftAmountTy may be too small
to hold shift values (it is an i8 on x86-32).
Before and during type legalization, use a large
but legal type for shift amounts: getPointerTy;
afterwards use getShiftAmountTy, fixing up any
shift amounts with a big type during operation
legalization.  Thanks to Dan for writing the
original patch (which I shamelessly pillaged).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63482 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
include/llvm/CodeGen/SelectionDAG.h
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
lib/CodeGen/SelectionDAG/TargetLowering.cpp
test/CodeGen/X86/2009-01-31-BigShift.ll [new file with mode: 0644]
test/CodeGen/X86/2009-01-31-BigShift2.ll [new file with mode: 0644]
test/CodeGen/X86/2009-01-31-BigShift3.ll [new file with mode: 0644]