-; This testcase, obviously distilled from a large program (bzip2 from Specint2000)
-; caused instcombine to fail because it got the same instruction on it's worklist
-; more than once (which is ok), but then deleted the instruction. Since the inst
-; stayed on the worklist, as soon as it came back up to be processed, bad things
-; happened, and opt asserted.
+; This testcase, obviously distilled from a large program (bzip2 from
+; Specint2000) caused instcombine to fail because it got the same instruction
+; on it's worklist more than once (which is ok), but then deleted the
+; instruction. Since the inst stayed on the worklist, as soon as it came back
+; up to be processed, bad things happened, and opt asserted.
;
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine
+; END.
;
%.LC0 = internal global [21 x sbyte] c"hbMakeCodeLengths(1)\00" ; <[21 x sbyte]*> [#uses=1]
;
; Extra code:
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine
+; END.
;
target endian = little
;
; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | \
; RUN: notcast .*int
+; END.
implementation ; Functions:
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output
+; END.
%struct.DecRefPicMarking_s = type { int, int, int, int, int, %struct.DecRefPicMarking_s* }
%struct.datapartition = type { %typedef.Bitstream*, %typedef.DecodingEnvironment, int (%struct.syntaxelement*, %struct.img_par*, %struct.inp_par*, %struct.datapartition*)* }
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output
+; END.
void %test() {
bb38.i:
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output
+; END.
%struct.gs_matrix = type { float, int, float, int, float, int, float, int, float, int, float, int }
%struct.gx_bitmap = type { ubyte*, int, int, int }
-; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output
; PR905
+; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output
+; END.
%RPYTHON_EXCEPTION = type { %RPYTHON_EXCEPTION_VTABLE* }
%RPYTHON_EXCEPTION_VTABLE = type { %RPYTHON_EXCEPTION_VTABLE*, int, int, %RPyOpaque_RuntimeTypeInfo*, %arraytype_Char*, %functiontype_12* }
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep select
; END.
+
target datalayout = "e-p:32:32"
target endian = little
target pointersize = 32
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep -v {icmp ult int}
; END.
+
; ModuleID = 'good.bc'
target datalayout = "e-p:32:32"
target endian = little
; operands is encountered.
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output
; END.
+
; ModuleID = 'PR1065.bc'
target datalayout = "e-p:32:32"
target endian = little
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
; RUN: grep {ashr i32 %.mp137, 2}
; END.
+
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"
target triple = "i686-pc-linux-gnu"
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep select | not grep {i32\\*}
+; END.
; This testcase corresponds to PR362, which notices that this horrible code
; is generated by the C++ front-end and LLVM optimizers, which has lots of
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep -v OK | not grep add
+; END.
implementation
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep {or }
+; END.
int %test1(int %X, int %Y) {
%A = and int %X, 7
;
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep and
+; END.
implementation
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
; RUN: grep -v OK | not grep add
-
+; END.
define i111 @test1(i111 %x) {
%tmp.2 = shl i111 1, 110
; This tests arbitrary precision integers.
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {or }
+; END.
define i17 @test1(i17 %X, i17 %Y) {
%A = and i17 %X, 7
; This test is for Integer BitWidth <= 64 && BitWidth % 8 != 0.
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {and }
+; END.
define i39 @test0(i39 %A) {
%B = and i39 %A, 0 ; zero result
; This test is for Integer BitWidth > 64 && BitWidth <= 1024.
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {and }
+; END.
define i999 @test0(i999 %A) {
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
; RUN: grep -v {sub i19 %Cok, %Bok} | not grep sub
+; END.
define i23 @test1(i23 %A) {
%B = sub i23 %A, %A ; <i23> [#uses=1]
; This test is for Integer BitWidth > 64 && BitWidth <= 1024.
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {xor }
+; END.
define i447 @test1(i447 %A, i447 %B) {
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep {call.*llvm.bswap} | wc -l | grep 5
+; END.
uint %test1(uint %i) {
%tmp1 = shr uint %i, ubyte 24 ; <uint> [#uses=1]
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep call | notcast
+; END.
implementation
; Tests to make sure elimination of casts is working correctly
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep %c | notcast
+; END.
%inbuf = external global [32832 x ubyte]
;
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep div
+; END.
implementation
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep getelementptr
+; END.
bool %test1(short* %P, int %I, int %J) {
%X = getelementptr short* %P, int %I
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep -v %B | not grep getelementptr
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep foo1
+; END.
%Global = constant [10 x sbyte] c"helloworld"
; This test makes sure that mul instructions are properly eliminated.
;
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep mul
+; END.
implementation
;
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep -v xor | not grep {or }
+; END.
implementation
; This test makes sure that these instructions are properly eliminated.
;
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep phi
+; END.
implementation
; This test makes sure that these instructions are properly eliminated.
;
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep rem
+; END.
implementation
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep select
+; END.
implementation
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep {(and\|xor\|add\|shl\|shr)}
+; END.
int %test1(int %x) {
%tmp.1 = and int %x, 65535 ; <int> [#uses=1]
; RUN: not grep insertelement
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep extractelement
+; END.
<4 x float> %test(<4 x float> %tmp, <4 x float> %tmp1) {
%tmp4 = extractelement <4 x float> %tmp, uint 1 ; <float> [#uses=1]
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep vector_shuffle
+; END.
%T = type <4 x float>