blob: 4a69067f5f185b338ab645abede289c2a0d16d6a [file] [log] [blame]
Rafael Espindolaa45c20b2011-08-30 23:03:45 +00001; RUN: opt < %s -instcombine -simplifycfg -licm -disable-output
Tanya Lattner8bf97c22008-03-25 04:26:08 +00002target datalayout = "e-p:32:32"
3@yy_base = external global [787 x i16] ; <[787 x i16]*> [#uses=1]
4@yy_state_ptr = external global i32* ; <i32**> [#uses=3]
5@yy_state_buf = external global [16386 x i32] ; <[16386 x i32]*> [#uses=1]
6@yy_lp = external global i32 ; <i32*> [#uses=1]
Chris Lattnerf38f8272003-08-15 23:15:37 +00007
Tanya Lattner8bf97c22008-03-25 04:26:08 +00008define i32 @_yylex() {
Chris Lattnerf38f8272003-08-15 23:15:37 +00009 br label %loopentry.0
Tanya Lattner8bf97c22008-03-25 04:26:08 +000010loopentry.0: ; preds = %else.26, %0
David Blaikief72d05b2015-03-13 18:20:45 +000011 store i32* getelementptr ([16386 x i32], [16386 x i32]* @yy_state_buf, i64 0, i64 0), i32** @yy_state_ptr
David Blaikiea79ac142015-02-27 21:17:42 +000012 %tmp.35 = load i32*, i32** @yy_state_ptr ; <i32*> [#uses=2]
David Blaikie79e6c742015-02-27 19:29:02 +000013 %inc.0 = getelementptr i32, i32* %tmp.35, i64 1 ; <i32*> [#uses=1]
Tanya Lattner8bf97c22008-03-25 04:26:08 +000014 store i32* %inc.0, i32** @yy_state_ptr
David Blaikiea79ac142015-02-27 21:17:42 +000015 %tmp.36 = load i32, i32* null ; <i32> [#uses=1]
Tanya Lattner8bf97c22008-03-25 04:26:08 +000016 store i32 %tmp.36, i32* %tmp.35
Chris Lattnerf38f8272003-08-15 23:15:37 +000017 br label %loopexit.2
Tanya Lattner8bf97c22008-03-25 04:26:08 +000018loopexit.2: ; preds = %else.26, %loopexit.2, %loopentry.0
19 store i8* null, i8** null
David Blaikiea79ac142015-02-27 21:17:42 +000020 %tmp.91 = load i32, i32* null ; <i32> [#uses=1]
Tanya Lattner8bf97c22008-03-25 04:26:08 +000021 %tmp.92 = sext i32 %tmp.91 to i64 ; <i64> [#uses=1]
David Blaikie79e6c742015-02-27 19:29:02 +000022 %tmp.93 = getelementptr [787 x i16], [787 x i16]* @yy_base, i64 0, i64 %tmp.92 ; <i16*> [#uses=1]
David Blaikiea79ac142015-02-27 21:17:42 +000023 %tmp.94 = load i16, i16* %tmp.93 ; <i16> [#uses=1]
Tanya Lattner8bf97c22008-03-25 04:26:08 +000024 %tmp.95 = icmp ne i16 %tmp.94, 4394 ; <i1> [#uses=1]
25 br i1 %tmp.95, label %loopexit.2, label %yy_find_action
26yy_find_action: ; preds = %else.26, %loopexit.2
Chris Lattnerf38f8272003-08-15 23:15:37 +000027 br label %loopentry.3
Tanya Lattner8bf97c22008-03-25 04:26:08 +000028loopentry.3: ; preds = %then.9, %shortcirc_done.0, %yy_find_action
David Blaikiea79ac142015-02-27 21:17:42 +000029 %tmp.105 = load i32, i32* @yy_lp ; <i32> [#uses=1]
Tanya Lattner8bf97c22008-03-25 04:26:08 +000030 %tmp.106 = icmp ne i32 %tmp.105, 0 ; <i1> [#uses=1]
31 br i1 %tmp.106, label %shortcirc_next.0, label %shortcirc_done.0
Chris Lattnerf38f8272003-08-15 23:15:37 +000032shortcirc_next.0: ; preds = %loopentry.3
David Blaikiea79ac142015-02-27 21:17:42 +000033 %tmp.114 = load i16, i16* null ; <i16> [#uses=1]
Tanya Lattner8bf97c22008-03-25 04:26:08 +000034 %tmp.115 = sext i16 %tmp.114 to i32 ; <i32> [#uses=1]
35 %tmp.116 = icmp slt i32 0, %tmp.115 ; <i1> [#uses=1]
Chris Lattnerf38f8272003-08-15 23:15:37 +000036 br label %shortcirc_done.0
Tanya Lattner8bf97c22008-03-25 04:26:08 +000037shortcirc_done.0: ; preds = %shortcirc_next.0, %loopentry.3
38 %shortcirc_val.0 = phi i1 [ false, %loopentry.3 ], [ %tmp.116, %shortcirc_next.0 ] ; <i1> [#uses=1]
39 br i1 %shortcirc_val.0, label %else.0, label %loopentry.3
Chris Lattnerf38f8272003-08-15 23:15:37 +000040else.0: ; preds = %shortcirc_done.0
David Blaikiea79ac142015-02-27 21:17:42 +000041 %tmp.144 = load i32, i32* null ; <i32> [#uses=1]
Tanya Lattner8bf97c22008-03-25 04:26:08 +000042 %tmp.145 = and i32 %tmp.144, 8192 ; <i32> [#uses=1]
43 %tmp.146 = icmp ne i32 %tmp.145, 0 ; <i1> [#uses=1]
44 br i1 %tmp.146, label %then.9, label %else.26
Chris Lattnerf38f8272003-08-15 23:15:37 +000045then.9: ; preds = %else.0
46 br label %loopentry.3
Tanya Lattner8bf97c22008-03-25 04:26:08 +000047else.26: ; preds = %else.0
48 switch i32 0, label %loopentry.0 [
49 i32 2, label %yy_find_action
50 i32 0, label %loopexit.2
Chris Lattnerf38f8272003-08-15 23:15:37 +000051 ]
52}