1 ; RUN: llc < %s -march=x86 2 ; PR4753 3 4 ; This function has a sub-register reuse undone. 5 6 @uint8 = external global i32 ; <i32*> [#uses=3] 7 8 declare signext i8 @foo(i32, i8 signext) nounwind readnone 9 10 declare signext i8 @bar(i32, i8 signext) nounwind readnone 11 12 define i32 @uint80(i8 signext %p_52) nounwind { 13 entry: 14 %0 = sext i8 %p_52 to i16 ; <i16> [#uses=1] 15 %1 = tail call i32 @func_24(i16 zeroext %0, i8 signext ptrtoint (i8 (i32, i8)* @foo to i8)) nounwind; <i32> [#uses=1] 16 %2 = trunc i32 %1 to i8 ; <i8> [#uses=1] 17 %3 = or i8 %2, 1 ; <i8> [#uses=1] 18 %4 = tail call i32 @safe(i32 1) nounwind ; <i32> [#uses=0] 19 %5 = tail call i32 @func_24(i16 zeroext 0, i8 signext undef) nounwind; <i32> [#uses=1] 20 %6 = trunc i32 %5 to i8 ; <i8> [#uses=1] 21 %7 = xor i8 %3, %p_52 ; <i8> [#uses=1] 22 %8 = xor i8 %7, %6 ; <i8> [#uses=1] 23 %9 = icmp ne i8 %p_52, 0 ; <i1> [#uses=1] 24 %10 = zext i1 %9 to i8 ; <i8> [#uses=1] 25 %11 = tail call i32 @func_24(i16 zeroext ptrtoint (i8 (i32, i8)* @bar to i16), i8 signext %10) nounwind; <i32> [#uses=1] 26 %12 = tail call i32 @func_24(i16 zeroext 0, i8 signext 1) nounwind; <i32> [#uses=0] 27 br i1 undef, label %bb2, label %bb 28 29 bb: ; preds = %entry 30 br i1 undef, label %bb2, label %bb3 31 32 bb2: ; preds = %bb, %entry 33 br label %bb3 34 35 bb3: ; preds = %bb2, %bb 36 %iftmp.2.0 = phi i32 [ 0, %bb2 ], [ 1, %bb ] ; <i32> [#uses=1] 37 %13 = icmp ne i32 %11, %iftmp.2.0 ; <i1> [#uses=1] 38 %14 = tail call i32 @safe(i32 -2) nounwind ; <i32> [#uses=0] 39 %15 = zext i1 %13 to i8 ; <i8> [#uses=1] 40 %16 = tail call signext i8 @func_53(i8 signext undef, i8 signext 1, i8 signext %15, i8 signext %8) nounwind; <i8> [#uses=0] 41 br i1 undef, label %bb5, label %bb4 42 43 bb4: ; preds = %bb3 44 %17 = volatile load i32* @uint8, align 4 ; <i32> [#uses=0] 45 br label %bb5 46 47 bb5: ; preds = %bb4, %bb3 48 %18 = volatile load i32* @uint8, align 4 ; <i32> [#uses=0] 49 %19 = sext i8 undef to i16 ; <i16> [#uses=1] 50 %20 = tail call i32 @func_24(i16 zeroext %19, i8 signext 1) nounwind; <i32> [#uses=0] 51 br i1 undef, label %return, label %bb6.preheader 52 53 bb6.preheader: ; preds = %bb5 54 %21 = sext i8 %p_52 to i32 ; <i32> [#uses=1] 55 %22 = volatile load i32* @uint8, align 4 ; <i32> [#uses=0] 56 %23 = tail call i32 (...)* @safefuncts(i32 %21, i32 1) nounwind; <i32> [#uses=0] 57 unreachable 58 59 return: ; preds = %bb5 60 ret i32 undef 61 } 62 63 declare i32 @func_24(i16 zeroext, i8 signext) 64 65 declare i32 @safe(i32) 66 67 declare signext i8 @func_53(i8 signext, i8 signext, i8 signext, i8 signext) 68 69 declare i32 @safefuncts(...) 70