91 lines · plain
1; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-unknown-linux-gnu | FileCheck %s2 3@_ZL10DeviceCode = internal global i16 0 ; <ptr> [#uses=1]4@.str19 = internal constant [64 x i8] c"unlock_then_erase_sector: failed to erase block (status= 0x%x)\0A\00" ; <ptr> [#uses=1]5@.str34 = internal constant [68 x i8] c"ProgramByWords - Erasing sector 0x%llx to 0x%llx (size 0x%x bytes)\0A\00" ; <ptr> [#uses=1]6@.str35 = internal constant [37 x i8] c"ProgramByWords - Done erasing flash\0A\00" ; <ptr> [#uses=1]7@.str36 = internal constant [48 x i8] c"ProgramByWords - Starting to write to FLASH...\0A\00" ; <ptr> [#uses=1]8 9declare void @IOLog(ptr, ...)10 11declare void @IODelay(i32)12 13; CHECK: @_Z14ProgramByWordsPvyy14; CHECK: blr15define i32 @_Z14ProgramByWordsPvyy(ptr %buffer, i64 %Offset, i64 %bufferSize) nounwind {16entry:17 store volatile i8 -1, ptr null, align 118 %tmp28 = icmp eq i8 0, 0 ; <i1> [#uses=1]19 br i1 %tmp28, label %bb107, label %bb20 21bb: ; preds = %entry22 %tmp9596430 = zext i32 0 to i64 ; <i64> [#uses=1]23 %tmp98431 = add i64 %tmp9596430, %Offset ; <i64> [#uses=1]24 %tmp100433 = icmp ugt i64 %tmp98431, %Offset ; <i1> [#uses=1]25 br i1 %tmp100433, label %bb31, label %bb10326 27bb31: ; preds = %_Z24unlock_then_erase_sectory.exit, %bb28 %Pos.0.reg2mem.0 = phi i64 [ %tmp93, %_Z24unlock_then_erase_sectory.exit ], [ %Offset, %bb ] ; <i64> [#uses=3]29 %tmp35 = load i16, ptr @_ZL10DeviceCode, align 2 ; <i16> [#uses=1]30 %tmp3536 = zext i16 %tmp35 to i32 ; <i32> [#uses=2]31 %tmp37 = and i32 %tmp3536, 65520 ; <i32> [#uses=1]32 %tmp38 = icmp eq i32 %tmp37, 35008 ; <i1> [#uses=1]33 %tmp34 = sub i64 %Pos.0.reg2mem.0, %Offset ; <i64> [#uses=2]34 br i1 %tmp38, label %bb41, label %bb6835 36bb41: ; preds = %bb3137 %tmp43 = add i32 0, -1 ; <i32> [#uses=1]38 %tmp4344 = zext i32 %tmp43 to i64 ; <i64> [#uses=1]39 %tmp46 = and i64 %tmp4344, %tmp34 ; <i64> [#uses=0]40 %tmp49 = and i32 %tmp3536, 1 ; <i32> [#uses=0]41 ret i32 042 43bb68: ; preds = %bb3144 tail call void (ptr, ...) @IOLog( ptr @.str34, i64 %tmp34, i64 0, i32 131072 ) nounwind 45 %tmp2021.i = trunc i64 %Pos.0.reg2mem.0 to i32 ; <i32> [#uses=1]46 %tmp202122.i = inttoptr i32 %tmp2021.i to ptr ; <ptr> [#uses=1]47 tail call void @IODelay( i32 500 ) nounwind 48 %tmp53.i = load volatile i16, ptr null, align 2 ; <i16> [#uses=2]49 %tmp5455.i = zext i16 %tmp53.i to i32 ; <i32> [#uses=1]50 br i1 false, label %bb.i, label %bb65.i51 52bb.i: ; preds = %bb6853 ret i32 054 55bb65.i: ; preds = %bb6856 %tmp67.i = icmp eq i16 %tmp53.i, 128 ; <i1> [#uses=1]57 br i1 %tmp67.i, label %_Z24unlock_then_erase_sectory.exit, label %bb70.i58 59bb70.i: ; preds = %bb65.i60 tail call void (ptr, ...) @IOLog( ptr @.str19, i32 %tmp5455.i ) nounwind 61 ret i32 062 63_Z24unlock_then_erase_sectory.exit: ; preds = %bb65.i64 store volatile i8 -1, ptr %tmp202122.i, align 165 %tmp93 = add i64 0, %Pos.0.reg2mem.0 ; <i64> [#uses=2]66 %tmp98 = add i64 0, %Offset ; <i64> [#uses=1]67 %tmp100 = icmp ugt i64 %tmp98, %tmp93 ; <i1> [#uses=1]68 br i1 %tmp100, label %bb31, label %bb10369 70bb103: ; preds = %_Z24unlock_then_erase_sectory.exit, %bb71 tail call void (ptr, ...) @IOLog( ptr @.str35 ) nounwind 72 ret i32 073 74bb107: ; preds = %entry75 tail call void (ptr, ...) @IOLog( ptr @.str36 ) nounwind 76 %tmp256 = lshr i64 %bufferSize, 1 ; <i64> [#uses=1]77 %tmp256257 = trunc i64 %tmp256 to i32 ; <i32> [#uses=1]78 %tmp258 = getelementptr i16, ptr %buffer, i32 %tmp256257 ; <ptr> [#uses=0]79 ret i32 080}81 82define i32 @_Z17program_64B_blockyPm(i64 %Base, ptr %pData) nounwind {83entry:84 unreachable85}86 87define i32 @_Z15ProgramByBlocksyy(i64 %Offset, i64 %bufferSize) nounwind {88entry:89 ret i32 090}91