brintos

brintos / llvm-project-archived public Read only

0
0
Text · 12.6 KiB · ab71110 Raw
411 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc  -O0 -mtriple=mipsel-linux-gnu -global-isel  -verify-machineinstrs %s -o -| FileCheck %s -check-prefixes=MIPS323 4define i1 @phi_i1(i1 %cnd, i1 %a, i1 %b) {5; MIPS32-LABEL: phi_i1:6; MIPS32:       # %bb.0: # %entry7; MIPS32-NEXT:    addiu $sp, $sp, -168; MIPS32-NEXT:    .cfi_def_cfa_offset 169; MIPS32-NEXT:    sw $5, 8($sp) # 4-byte Folded Spill10; MIPS32-NEXT:    sw $6, 12($sp) # 4-byte Folded Spill11; MIPS32-NEXT:    andi $1, $4, 112; MIPS32-NEXT:    bnez $1, $BB0_213; MIPS32-NEXT:    nop14; MIPS32-NEXT:  # %bb.1: # %entry15; MIPS32-NEXT:    j $BB0_316; MIPS32-NEXT:    nop17; MIPS32-NEXT:  $BB0_2: # %cond.true18; MIPS32-NEXT:    lw $1, 8($sp) # 4-byte Folded Reload19; MIPS32-NEXT:    sw $1, 4($sp) # 4-byte Folded Spill20; MIPS32-NEXT:    j $BB0_421; MIPS32-NEXT:    nop22; MIPS32-NEXT:  $BB0_3: # %cond.false23; MIPS32-NEXT:    lw $1, 12($sp) # 4-byte Folded Reload24; MIPS32-NEXT:    sw $1, 4($sp) # 4-byte Folded Spill25; MIPS32-NEXT:    j $BB0_426; MIPS32-NEXT:    nop27; MIPS32-NEXT:  $BB0_4: # %cond.end28; MIPS32-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload29; MIPS32-NEXT:    addiu $sp, $sp, 1630; MIPS32-NEXT:    jr $ra31; MIPS32-NEXT:    nop32entry:33  br i1 %cnd, label %cond.true, label %cond.false34 35cond.true:36  br label %cond.end37 38cond.false:39  br label %cond.end40 41cond.end:42  %cond = phi i1 [ %a, %cond.true ], [ %b, %cond.false ]43  ret i1 %cond44}45 46define i8 @phi_i8(i1 %cnd, i8 %a, i8 %b) {47; MIPS32-LABEL: phi_i8:48; MIPS32:       # %bb.0: # %entry49; MIPS32-NEXT:    addiu $sp, $sp, -1650; MIPS32-NEXT:    .cfi_def_cfa_offset 1651; MIPS32-NEXT:    sw $5, 8($sp) # 4-byte Folded Spill52; MIPS32-NEXT:    sw $6, 12($sp) # 4-byte Folded Spill53; MIPS32-NEXT:    andi $1, $4, 154; MIPS32-NEXT:    bnez $1, $BB1_255; MIPS32-NEXT:    nop56; MIPS32-NEXT:  # %bb.1: # %entry57; MIPS32-NEXT:    j $BB1_358; MIPS32-NEXT:    nop59; MIPS32-NEXT:  $BB1_2: # %cond.true60; MIPS32-NEXT:    lw $1, 8($sp) # 4-byte Folded Reload61; MIPS32-NEXT:    sw $1, 4($sp) # 4-byte Folded Spill62; MIPS32-NEXT:    j $BB1_463; MIPS32-NEXT:    nop64; MIPS32-NEXT:  $BB1_3: # %cond.false65; MIPS32-NEXT:    lw $1, 12($sp) # 4-byte Folded Reload66; MIPS32-NEXT:    sw $1, 4($sp) # 4-byte Folded Spill67; MIPS32-NEXT:    j $BB1_468; MIPS32-NEXT:    nop69; MIPS32-NEXT:  $BB1_4: # %cond.end70; MIPS32-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload71; MIPS32-NEXT:    addiu $sp, $sp, 1672; MIPS32-NEXT:    jr $ra73; MIPS32-NEXT:    nop74entry:75  br i1 %cnd, label %cond.true, label %cond.false76 77cond.true:78  br label %cond.end79 80cond.false:81  br label %cond.end82 83cond.end:84  %cond = phi i8 [ %a, %cond.true ], [ %b, %cond.false ]85  ret i8 %cond86}87 88define i16 @phi_i16(i1 %cnd, i16 %a, i16 %b) {89; MIPS32-LABEL: phi_i16:90; MIPS32:       # %bb.0: # %entry91; MIPS32-NEXT:    addiu $sp, $sp, -1692; MIPS32-NEXT:    .cfi_def_cfa_offset 1693; MIPS32-NEXT:    sw $5, 8($sp) # 4-byte Folded Spill94; MIPS32-NEXT:    sw $6, 12($sp) # 4-byte Folded Spill95; MIPS32-NEXT:    andi $1, $4, 196; MIPS32-NEXT:    bnez $1, $BB2_297; MIPS32-NEXT:    nop98; MIPS32-NEXT:  # %bb.1: # %entry99; MIPS32-NEXT:    j $BB2_3100; MIPS32-NEXT:    nop101; MIPS32-NEXT:  $BB2_2: # %cond.true102; MIPS32-NEXT:    lw $1, 8($sp) # 4-byte Folded Reload103; MIPS32-NEXT:    sw $1, 4($sp) # 4-byte Folded Spill104; MIPS32-NEXT:    j $BB2_4105; MIPS32-NEXT:    nop106; MIPS32-NEXT:  $BB2_3: # %cond.false107; MIPS32-NEXT:    lw $1, 12($sp) # 4-byte Folded Reload108; MIPS32-NEXT:    sw $1, 4($sp) # 4-byte Folded Spill109; MIPS32-NEXT:    j $BB2_4110; MIPS32-NEXT:    nop111; MIPS32-NEXT:  $BB2_4: # %cond.end112; MIPS32-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload113; MIPS32-NEXT:    addiu $sp, $sp, 16114; MIPS32-NEXT:    jr $ra115; MIPS32-NEXT:    nop116entry:117  br i1 %cnd, label %cond.true, label %cond.false118 119cond.true:120  br label %cond.end121 122cond.false:123  br label %cond.end124 125cond.end:126  %cond = phi i16 [ %a, %cond.true ], [ %b, %cond.false ]127  ret i16 %cond128}129 130define i32 @phi_i32(i1 %cnd, i32 %a, i32 %b) {131; MIPS32-LABEL: phi_i32:132; MIPS32:       # %bb.0: # %entry133; MIPS32-NEXT:    addiu $sp, $sp, -16134; MIPS32-NEXT:    .cfi_def_cfa_offset 16135; MIPS32-NEXT:    sw $5, 8($sp) # 4-byte Folded Spill136; MIPS32-NEXT:    sw $6, 12($sp) # 4-byte Folded Spill137; MIPS32-NEXT:    andi $1, $4, 1138; MIPS32-NEXT:    bnez $1, $BB3_2139; MIPS32-NEXT:    nop140; MIPS32-NEXT:  # %bb.1: # %entry141; MIPS32-NEXT:    j $BB3_3142; MIPS32-NEXT:    nop143; MIPS32-NEXT:  $BB3_2: # %cond.true144; MIPS32-NEXT:    lw $1, 8($sp) # 4-byte Folded Reload145; MIPS32-NEXT:    sw $1, 4($sp) # 4-byte Folded Spill146; MIPS32-NEXT:    j $BB3_4147; MIPS32-NEXT:    nop148; MIPS32-NEXT:  $BB3_3: # %cond.false149; MIPS32-NEXT:    lw $1, 12($sp) # 4-byte Folded Reload150; MIPS32-NEXT:    sw $1, 4($sp) # 4-byte Folded Spill151; MIPS32-NEXT:    j $BB3_4152; MIPS32-NEXT:    nop153; MIPS32-NEXT:  $BB3_4: # %cond.end154; MIPS32-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload155; MIPS32-NEXT:    addiu $sp, $sp, 16156; MIPS32-NEXT:    jr $ra157; MIPS32-NEXT:    nop158entry:159  br i1 %cnd, label %cond.true, label %cond.false160 161cond.true:162  br label %cond.end163 164cond.false:165  br label %cond.end166 167cond.end:168  %cond = phi i32 [ %a, %cond.true ], [ %b, %cond.false ]169  ret i32 %cond170}171 172define i64 @phi_i64(i1 %cnd, i64 %a, i64 %b) {173; MIPS32-LABEL: phi_i64:174; MIPS32:       # %bb.0: # %entry175; MIPS32-NEXT:    addiu $sp, $sp, -24176; MIPS32-NEXT:    .cfi_def_cfa_offset 24177; MIPS32-NEXT:    sw $6, 8($sp) # 4-byte Folded Spill178; MIPS32-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill179; MIPS32-NEXT:    addiu $1, $sp, 40180; MIPS32-NEXT:    lw $1, 0($1)181; MIPS32-NEXT:    sw $1, 16($sp) # 4-byte Folded Spill182; MIPS32-NEXT:    addiu $1, $sp, 44183; MIPS32-NEXT:    lw $1, 0($1)184; MIPS32-NEXT:    sw $1, 20($sp) # 4-byte Folded Spill185; MIPS32-NEXT:    andi $1, $4, 1186; MIPS32-NEXT:    bnez $1, $BB4_2187; MIPS32-NEXT:    nop188; MIPS32-NEXT:  # %bb.1: # %entry189; MIPS32-NEXT:    j $BB4_3190; MIPS32-NEXT:    nop191; MIPS32-NEXT:  $BB4_2: # %cond.true192; MIPS32-NEXT:    lw $1, 12($sp) # 4-byte Folded Reload193; MIPS32-NEXT:    lw $2, 8($sp) # 4-byte Folded Reload194; MIPS32-NEXT:    sw $2, 0($sp) # 4-byte Folded Spill195; MIPS32-NEXT:    sw $1, 4($sp) # 4-byte Folded Spill196; MIPS32-NEXT:    j $BB4_4197; MIPS32-NEXT:    nop198; MIPS32-NEXT:  $BB4_3: # %cond.false199; MIPS32-NEXT:    lw $1, 20($sp) # 4-byte Folded Reload200; MIPS32-NEXT:    lw $2, 16($sp) # 4-byte Folded Reload201; MIPS32-NEXT:    sw $2, 0($sp) # 4-byte Folded Spill202; MIPS32-NEXT:    sw $1, 4($sp) # 4-byte Folded Spill203; MIPS32-NEXT:    j $BB4_4204; MIPS32-NEXT:    nop205; MIPS32-NEXT:  $BB4_4: # %cond.end206; MIPS32-NEXT:    lw $2, 0($sp) # 4-byte Folded Reload207; MIPS32-NEXT:    lw $3, 4($sp) # 4-byte Folded Reload208; MIPS32-NEXT:    addiu $sp, $sp, 24209; MIPS32-NEXT:    jr $ra210; MIPS32-NEXT:    nop211entry:212  br i1 %cnd, label %cond.true, label %cond.false213 214cond.true:215  br label %cond.end216 217cond.false:218  br label %cond.end219 220cond.end:221  %cond = phi i64 [ %a, %cond.true ], [ %b, %cond.false ]222  ret i64 %cond223}224 225define void @phi_ambiguous_i64_in_fpr(i1 %cnd, ptr %i64_ptr_a, ptr %i64_ptr_b, ptr %i64_ptr_c) {226; MIPS32-LABEL: phi_ambiguous_i64_in_fpr:227; MIPS32:       # %bb.0: # %entry228; MIPS32-NEXT:    addiu $sp, $sp, -32229; MIPS32-NEXT:    .cfi_def_cfa_offset 32230; MIPS32-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill231; MIPS32-NEXT:    ldc1 $f0, 0($5)232; MIPS32-NEXT:    sdc1 $f0, 16($sp) # 8-byte Folded Spill233; MIPS32-NEXT:    ldc1 $f0, 0($6)234; MIPS32-NEXT:    sdc1 $f0, 24($sp) # 8-byte Folded Spill235; MIPS32-NEXT:    andi $1, $4, 1236; MIPS32-NEXT:    bnez $1, $BB5_2237; MIPS32-NEXT:    nop238; MIPS32-NEXT:  # %bb.1: # %entry239; MIPS32-NEXT:    j $BB5_3240; MIPS32-NEXT:    nop241; MIPS32-NEXT:  $BB5_2: # %cond.true242; MIPS32-NEXT:    ldc1 $f0, 16($sp) # 8-byte Folded Reload243; MIPS32-NEXT:    sdc1 $f0, 0($sp) # 8-byte Folded Spill244; MIPS32-NEXT:    j $BB5_4245; MIPS32-NEXT:    nop246; MIPS32-NEXT:  $BB5_3: # %cond.false247; MIPS32-NEXT:    ldc1 $f0, 24($sp) # 8-byte Folded Reload248; MIPS32-NEXT:    sdc1 $f0, 0($sp) # 8-byte Folded Spill249; MIPS32-NEXT:    j $BB5_4250; MIPS32-NEXT:    nop251; MIPS32-NEXT:  $BB5_4: # %cond.end252; MIPS32-NEXT:    lw $1, 12($sp) # 4-byte Folded Reload253; MIPS32-NEXT:    ldc1 $f0, 0($sp) # 8-byte Folded Reload254; MIPS32-NEXT:    sdc1 $f0, 0($1)255; MIPS32-NEXT:    addiu $sp, $sp, 32256; MIPS32-NEXT:    jr $ra257; MIPS32-NEXT:    nop258entry:259  %0 = load i64, ptr %i64_ptr_a, align 8260  %1 = load i64, ptr %i64_ptr_b, align 8261  br i1 %cnd, label %cond.true, label %cond.false262 263cond.true:264  br label %cond.end265 266cond.false:267  br label %cond.end268 269cond.end:270  %cond = phi i64 [ %0, %cond.true ], [ %1, %cond.false ]271  store i64 %cond, ptr %i64_ptr_c, align 8272  ret void273}274 275define float @phi_float(i1 %cnd, float %a, float %b) {276; MIPS32-LABEL: phi_float:277; MIPS32:       # %bb.0: # %entry278; MIPS32-NEXT:    addiu $sp, $sp, -16279; MIPS32-NEXT:    .cfi_def_cfa_offset 16280; MIPS32-NEXT:    sw $5, 8($sp) # 4-byte Folded Spill281; MIPS32-NEXT:    sw $6, 12($sp) # 4-byte Folded Spill282; MIPS32-NEXT:    andi $1, $4, 1283; MIPS32-NEXT:    bnez $1, $BB6_2284; MIPS32-NEXT:    nop285; MIPS32-NEXT:  # %bb.1: # %entry286; MIPS32-NEXT:    j $BB6_3287; MIPS32-NEXT:    nop288; MIPS32-NEXT:  $BB6_2: # %cond.true289; MIPS32-NEXT:    lw $1, 8($sp) # 4-byte Folded Reload290; MIPS32-NEXT:    sw $1, 4($sp) # 4-byte Folded Spill291; MIPS32-NEXT:    j $BB6_4292; MIPS32-NEXT:    nop293; MIPS32-NEXT:  $BB6_3: # %cond.false294; MIPS32-NEXT:    lw $1, 12($sp) # 4-byte Folded Reload295; MIPS32-NEXT:    sw $1, 4($sp) # 4-byte Folded Spill296; MIPS32-NEXT:    j $BB6_4297; MIPS32-NEXT:    nop298; MIPS32-NEXT:  $BB6_4: # %cond.end299; MIPS32-NEXT:    lw $1, 4($sp) # 4-byte Folded Reload300; MIPS32-NEXT:    mtc1 $1, $f0301; MIPS32-NEXT:    addiu $sp, $sp, 16302; MIPS32-NEXT:    jr $ra303; MIPS32-NEXT:    nop304entry:305  br i1 %cnd, label %cond.true, label %cond.false306 307cond.true:308  br label %cond.end309 310cond.false:311  br label %cond.end312 313cond.end:314  %cond = phi float [ %a, %cond.true ], [ %b, %cond.false ]315  ret float %cond316}317 318define void @phi_ambiguous_float_in_gpr(i1 %cnd, ptr %f32_ptr_a, ptr %f32_ptr_b, ptr %f32_ptr_c) {319; MIPS32-LABEL: phi_ambiguous_float_in_gpr:320; MIPS32:       # %bb.0: # %entry321; MIPS32-NEXT:    addiu $sp, $sp, -16322; MIPS32-NEXT:    .cfi_def_cfa_offset 16323; MIPS32-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill324; MIPS32-NEXT:    lw $1, 0($5)325; MIPS32-NEXT:    sw $1, 8($sp) # 4-byte Folded Spill326; MIPS32-NEXT:    lw $1, 0($6)327; MIPS32-NEXT:    sw $1, 12($sp) # 4-byte Folded Spill328; MIPS32-NEXT:    andi $1, $4, 1329; MIPS32-NEXT:    bnez $1, $BB7_2330; MIPS32-NEXT:    nop331; MIPS32-NEXT:  # %bb.1: # %entry332; MIPS32-NEXT:    j $BB7_3333; MIPS32-NEXT:    nop334; MIPS32-NEXT:  $BB7_2: # %cond.true335; MIPS32-NEXT:    lw $1, 8($sp) # 4-byte Folded Reload336; MIPS32-NEXT:    sw $1, 0($sp) # 4-byte Folded Spill337; MIPS32-NEXT:    j $BB7_4338; MIPS32-NEXT:    nop339; MIPS32-NEXT:  $BB7_3: # %cond.false340; MIPS32-NEXT:    lw $1, 12($sp) # 4-byte Folded Reload341; MIPS32-NEXT:    sw $1, 0($sp) # 4-byte Folded Spill342; MIPS32-NEXT:    j $BB7_4343; MIPS32-NEXT:    nop344; MIPS32-NEXT:  $BB7_4: # %cond.end345; MIPS32-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload346; MIPS32-NEXT:    lw $1, 0($sp) # 4-byte Folded Reload347; MIPS32-NEXT:    sw $1, 0($2)348; MIPS32-NEXT:    addiu $sp, $sp, 16349; MIPS32-NEXT:    jr $ra350; MIPS32-NEXT:    nop351entry:352  %0 = load float, ptr %f32_ptr_a, align 4353  %1 = load float, ptr %f32_ptr_b, align 4354  br i1 %cnd, label %cond.true, label %cond.false355 356cond.true:357  br label %cond.end358 359cond.false:360  br label %cond.end361 362cond.end:363  %cond = phi float [ %0, %cond.true ], [ %1, %cond.false ]364  store float %cond, ptr %f32_ptr_c, align 4365  ret void366}367 368define double @phi_double(double %a, double %b, i1 %cnd) {369; MIPS32-LABEL: phi_double:370; MIPS32:       # %bb.0: # %entry371; MIPS32-NEXT:    addiu $sp, $sp, -24372; MIPS32-NEXT:    .cfi_def_cfa_offset 24373; MIPS32-NEXT:    sdc1 $f12, 8($sp) # 8-byte Folded Spill374; MIPS32-NEXT:    sdc1 $f14, 16($sp) # 8-byte Folded Spill375; MIPS32-NEXT:    addiu $1, $sp, 40376; MIPS32-NEXT:    lw $1, 0($1)377; MIPS32-NEXT:    andi $1, $1, 1378; MIPS32-NEXT:    bnez $1, $BB8_2379; MIPS32-NEXT:    nop380; MIPS32-NEXT:  # %bb.1: # %entry381; MIPS32-NEXT:    j $BB8_3382; MIPS32-NEXT:    nop383; MIPS32-NEXT:  $BB8_2: # %cond.true384; MIPS32-NEXT:    ldc1 $f0, 8($sp) # 8-byte Folded Reload385; MIPS32-NEXT:    sdc1 $f0, 0($sp) # 8-byte Folded Spill386; MIPS32-NEXT:    j $BB8_4387; MIPS32-NEXT:    nop388; MIPS32-NEXT:  $BB8_3: # %cond.false389; MIPS32-NEXT:    ldc1 $f0, 16($sp) # 8-byte Folded Reload390; MIPS32-NEXT:    sdc1 $f0, 0($sp) # 8-byte Folded Spill391; MIPS32-NEXT:    j $BB8_4392; MIPS32-NEXT:    nop393; MIPS32-NEXT:  $BB8_4: # %cond.end394; MIPS32-NEXT:    ldc1 $f0, 0($sp) # 8-byte Folded Reload395; MIPS32-NEXT:    addiu $sp, $sp, 24396; MIPS32-NEXT:    jr $ra397; MIPS32-NEXT:    nop398entry:399  br i1 %cnd, label %cond.true, label %cond.false400 401cond.true:402  br label %cond.end403 404cond.false:405  br label %cond.end406 407cond.end:408  %cond = phi double [ %a, %cond.true ], [ %b, %cond.false ]409  ret double %cond410}411