brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.8 KiB · 4340d57 Raw
79 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 62; RUN: opt < %s -passes=gvn -S | FileCheck %s3 4; Two occurrences of strlen should be zapped.5target 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"6target triple = "i386-apple-darwin9"7 8define i32 @test(i32 %g, ptr %P) nounwind  {9; CHECK-LABEL: define i32 @test(10; CHECK-SAME: i32 [[G:%.*]], ptr [[P:%.*]]) #[[ATTR0:[0-9]+]] {11; CHECK-NEXT:  [[ENTRY:.*:]]12; CHECK-NEXT:    [[TMP2:%.*]] = call i32 @strlen(ptr [[P]]) #[[ATTR1:[0-9]+]]13; CHECK-NEXT:    [[TMP3:%.*]] = icmp eq i32 [[TMP2]], 10014; CHECK-NEXT:    [[TMP34:%.*]] = zext i1 [[TMP3]] to i815; CHECK-NEXT:    br i1 [[TMP3]], label %[[BB:.*]], label %[[BB6:.*]]16; CHECK:       [[BB]]:17; CHECK-NEXT:    br label %[[BB27:.*]]18; CHECK:       [[BB6]]:19; CHECK-NEXT:    [[TMP8:%.*]] = add i32 [[G]], 4220; CHECK-NEXT:    br i1 false, label %[[BB14:.*]], label %[[BB16:.*]]21; CHECK:       [[BB14]]:22; CHECK-NEXT:    br label %[[BB27]]23; CHECK:       [[BB16]]:24; CHECK-NEXT:    [[TMP18:%.*]] = mul i32 [[TMP8]], 225; CHECK-NEXT:    br i1 false, label %[[BB24:.*]], label %[[BB26:.*]]26; CHECK:       [[BB24]]:27; CHECK-NEXT:    br label %[[BB27]]28; CHECK:       [[BB26]]:29; CHECK-NEXT:    br label %[[BB27]]30; CHECK:       [[BB27]]:31; CHECK-NEXT:    [[TMP_0:%.*]] = phi i32 [ 11, %[[BB26]] ], [ poison, %[[BB24]] ], [ poison, %[[BB14]] ], [ [[G]], %[[BB]] ]32; CHECK-NEXT:    ret i32 [[TMP_0]]33;34entry:35  %tmp2 = call i32 @strlen( ptr %P ) nounwind readonly 		; <i32> [#uses=1]36  %tmp3 = icmp eq i32 %tmp2, 100		; <i1> [#uses=1]37  %tmp34 = zext i1 %tmp3 to i8		; <i8> [#uses=1]38  %toBool = icmp ne i8 %tmp34, 0		; <i1> [#uses=1]39  br i1 %toBool, label %bb, label %bb640 41bb:		; preds = %entry42  br label %bb2743 44bb6:		; preds = %entry45  %tmp8 = add i32 %g, 42		; <i32> [#uses=2]46  %tmp10 = call i32 @strlen( ptr %P ) nounwind readonly 		; <i32> [#uses=1]47  %tmp11 = icmp eq i32 %tmp10, 100		; <i1> [#uses=1]48  %tmp1112 = zext i1 %tmp11 to i8		; <i8> [#uses=1]49  %toBool13 = icmp ne i8 %tmp1112, 0		; <i1> [#uses=1]50  br i1 %toBool13, label %bb14, label %bb1651 52bb14:		; preds = %bb653  br label %bb2754 55bb16:		; preds = %bb656  %tmp18 = mul i32 %tmp8, 2		; <i32> [#uses=1]57  %tmp20 = call i32 @strlen( ptr %P ) nounwind readonly 		; <i32> [#uses=1]58  %tmp21 = icmp eq i32 %tmp20, 100		; <i1> [#uses=1]59  %tmp2122 = zext i1 %tmp21 to i8		; <i8> [#uses=1]60  %toBool23 = icmp ne i8 %tmp2122, 0		; <i1> [#uses=1]61  br i1 %toBool23, label %bb24, label %bb2662 63bb24:		; preds = %bb1664  br label %bb2765 66bb26:		; preds = %bb1667  br label %bb2768 69bb27:		; preds = %bb26, %bb24, %bb14, %bb70  %tmp.0 = phi i32 [ 11, %bb26 ], [ %tmp18, %bb24 ], [ %tmp8, %bb14 ], [ %g, %bb ]		; <i32> [#uses=1]71  br label %return72 73return:		; preds = %bb2774  ret i32 %tmp.075}76 77 78declare i32 @strlen(ptr) nounwind readonly79