diff options
author | Duncan Sands <baldrick@free.fr> | 2009-01-31 15:50:11 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2009-01-31 15:50:11 +0000 |
commit | 92abc62399881ba9c525be80362c134ad836e2d9 (patch) | |
tree | 596a2370bbd0b6c4279966b6885420abb878ae13 /test | |
parent | d1b5e3fad94d4a5203c0a355aa7d37c01abaca8c (diff) | |
download | llvm-92abc62399881ba9c525be80362c134ad836e2d9.tar.gz llvm-92abc62399881ba9c525be80362c134ad836e2d9.tar.bz2 llvm-92abc62399881ba9c525be80362c134ad836e2d9.tar.xz |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/X86/2009-01-31-BigShift.ll | 9 | ||||
-rw-r--r-- | test/CodeGen/X86/2009-01-31-BigShift2.ll | 11 | ||||
-rw-r--r-- | test/CodeGen/X86/2009-01-31-BigShift3.ll | 31 |
3 files changed, 51 insertions, 0 deletions
diff --git a/test/CodeGen/X86/2009-01-31-BigShift.ll b/test/CodeGen/X86/2009-01-31-BigShift.ll new file mode 100644 index 0000000000..360b4f0e46 --- /dev/null +++ b/test/CodeGen/X86/2009-01-31-BigShift.ll @@ -0,0 +1,9 @@ +; RUN: llvm-as < %s | llc -march=x86 | not grep and +; PR3401 + +define void @x(i288 %i) nounwind { + call void @add(i288 %i) + ret void +} + +declare void @add(i288) diff --git a/test/CodeGen/X86/2009-01-31-BigShift2.ll b/test/CodeGen/X86/2009-01-31-BigShift2.ll new file mode 100644 index 0000000000..2b5b189578 --- /dev/null +++ b/test/CodeGen/X86/2009-01-31-BigShift2.ll @@ -0,0 +1,11 @@ +; RUN: llvm-as < %s | llc -march=x86 | grep {mov.*56} +; PR3449 + +define void @test(<8 x double>* %P, i64* %Q) nounwind { + %A = load <8 x double>* %P ; <<8 x double>> [#uses=1] + %B = bitcast <8 x double> %A to i512 ; <i512> [#uses=1] + %C = lshr i512 %B, 448 ; <i512> [#uses=1] + %D = trunc i512 %C to i64 ; <i64> [#uses=1] + volatile store i64 %D, i64* %Q + ret void +} diff --git a/test/CodeGen/X86/2009-01-31-BigShift3.ll b/test/CodeGen/X86/2009-01-31-BigShift3.ll new file mode 100644 index 0000000000..c92c86a092 --- /dev/null +++ b/test/CodeGen/X86/2009-01-31-BigShift3.ll @@ -0,0 +1,31 @@ +; RUN: llvm-as < %s | llc -march=x86 +; PR3450 + +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i386-apple-darwin7" + %struct.BitMap = type { i8* } + %struct.BitMapListStruct = type { %struct.BitMap, %struct.BitMapListStruct*, %struct.BitMapListStruct* } + %struct.Material = type { float, float, float, %struct.Material*, %struct.Material* } + %struct.ObjPoint = type { double, double, double, double, double, double } + %struct.ObjectStruct = type { [57 x i8], %struct.PointListStruct*, %struct.Poly3Struct*, %struct.Poly4Struct*, %struct.Texture*, %struct.Material*, %struct.Point, i32, i32, %struct.Point, %struct.Point, %struct.Point, %struct.ObjectStruct*, %struct.ObjectStruct*, i32, i32, i32, i32, i32, i32, i32, %struct.ObjectStruct*, %struct.ObjectStruct* } + %struct.Point = type { double, double, double } + %struct.PointListStruct = type { %struct.ObjPoint*, %struct.PointListStruct*, %struct.PointListStruct* } + %struct.Poly3Struct = type { [3 x %struct.ObjPoint*], %struct.Material*, %struct.Texture*, %struct.Poly3Struct*, %struct.Poly3Struct* } + %struct.Poly4Struct = type { [4 x %struct.ObjPoint*], %struct.Material*, %struct.Texture*, %struct.Poly4Struct*, %struct.Poly4Struct* } + %struct.Texture = type { %struct.Point, %struct.BitMapListStruct*, %struct.Point, %struct.Point, %struct.Point, %struct.Texture*, %struct.Texture* } + +define fastcc void @ScaleObjectAdd(%struct.ObjectStruct* %o, double %sx, double %sy, double %sz) nounwind { +entry: + %sz101112.ins = or i960 0, 0 ; <i960> [#uses=1] + br i1 false, label %return, label %bb1.preheader + +bb1.preheader: ; preds = %entry + %0 = lshr i960 %sz101112.ins, 640 ; <i960> [#uses=0] + br label %bb1 + +bb1: ; preds = %bb1, %bb1.preheader + br label %bb1 + +return: ; preds = %entry + ret void +} |