; RUN: llc -march=mipsel -O3 -relocation-model=pic < %s | FileCheck %s ; MIPS direct branches implicitly define register $at. This test makes sure that ; code hoisting optimization (which moves identical instructions at the start of ; two basic blocks to the common predecessor block) takes this into account and ; doesn't move definition of $at to the predecessor block (which would make $at ; live-in at the start of successor block). ; CHECK-LABEL: readLumaCoeff8x8_CABAC ; The check for first "addiu" instruction is added so that we can match the correct "b" instruction. ; CHECK: andi ; CHECK: b $[[BB0:BB[0-9_]+]] ; CHECK: sll ; Check that at the start of a fallthrough block there is a instruction that writes to $1. ; CHECK: {{%bb.[0-9]+}}: ; CHECK: sll $1, $[[R0:[0-9]+]], 4 ; CHECK: lw $[[R1:[0-9]+]], %got(assignSE2partition)($[[R2:[0-9]+]]) ; Check that identical instructions are at the start of a target block. ; CHECK: [[BB0]]: ; CHECK: sll $1, $[[R0]], 4 ; CHECK: lw $[[R1]], %got(assignSE2partition)($[[R2]]) %struct.img_par = type { i32, i32, i32, i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [16 x [16 x i16]], [6 x [32 x i32]], [16 x [16 x i32]], [4 x [12 x [4 x [4 x i32]]]], [16 x i32], ptr, ptr, ptr, ptr, i32, i32, i32, i32, ptr, ptr, i32, i32, i32, i32, i32, i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [3 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [3 x [2 x i32]], [3 x [2 x i32]], i32, i32, i32, i32, %struct.timeb, %struct.timeb, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 } %struct.Slice = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, i32, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr, i32, i32, i32, i32 } %struct.datapartition = type { ptr, %struct.DecodingEnvironment, ptr } %struct.Bitstream = type { i32, i32, i32, i32, ptr, i32 } %struct.DecodingEnvironment = type { i32, i32, i32, i32, i32, ptr, ptr } %struct.syntaxelement = type { i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr } %struct.MotionInfoContexts = type { [4 x [11 x %struct.BiContextType]], [2 x [9 x %struct.BiContextType]], [2 x [10 x %struct.BiContextType]], [2 x [6 x %struct.BiContextType]], [4 x %struct.BiContextType], [4 x %struct.BiContextType], [3 x %struct.BiContextType] } %struct.BiContextType = type { i16, i8 } %struct.TextureInfoContexts = type { [2 x %struct.BiContextType], [4 x %struct.BiContextType], [3 x [4 x %struct.BiContextType]], [10 x [4 x %struct.BiContextType]], [10 x [15 x %struct.BiContextType]], [10 x [15 x %struct.BiContextType]], [10 x [5 x %struct.BiContextType]], [10 x [5 x %struct.BiContextType]], [10 x [15 x %struct.BiContextType]], [10 x [15 x %struct.BiContextType]] } %struct.inp_par = type { [1000 x i8], [1000 x i8], [1000 x i8], i32, i32, i32, i32, i32, i32, i32, i32 } %struct.macroblock = type { i32, [2 x i32], i32, i32, ptr, ptr, i32, [2 x [4 x [4 x [2 x i32]]]], i32, i64, i64, i32, i32, [4 x i8], [4 x i8], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 } %struct.DecRefPicMarking_s = type { i32, i32, i32, i32, i32, ptr } %struct.timeb = type { i32, i16, i16, i16 } @assignSE2partition = external global [0 x [20 x i32]] @FIELD_SCAN8x8 = external constant [64 x [2 x i8]] define void @readLumaCoeff8x8_CABAC(ptr %img, i32 %b8) { %1 = load i32, ptr undef, align 4 br i1 false, label %2, label %3 ;