brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 828b066 Raw
65 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc --mtriple=loongarch32 -mattr=+32s,+d < %s | FileCheck %s --check-prefix=LA323; RUN: llc --mtriple=loongarch64 -mattr=+d < %s | FileCheck %s --check-prefix=LA644 5declare i32 @llvm.loongarch.csrrd.w(i32 immarg) nounwind6declare i32 @llvm.loongarch.csrwr.w(i32, i32 immarg) nounwind7declare void @bug()8 9define dso_local void @foo(i32 noundef signext %flag) nounwind {10; LA32-LABEL: foo:11; LA32:       # %bb.0: # %entry12; LA32-NEXT:    beqz $a0, .LBB0_213; LA32-NEXT:  # %bb.1: # %if.then14; LA32-NEXT:    csrrd $a0, 215; LA32-NEXT:    ori $a0, $a0, 116; LA32-NEXT:    csrwr $a0, 217; LA32-NEXT:  .LBB0_2: # %if.end18; LA32-NEXT:    csrrd $a0, 219; LA32-NEXT:    andi $a0, $a0, 120; LA32-NEXT:    bnez $a0, .LBB0_421; LA32-NEXT:  # %bb.3: # %if.then222; LA32-NEXT:    b bug23; LA32-NEXT:  .LBB0_4: # %if.end324; LA32-NEXT:    ret25;26; LA64-LABEL: foo:27; LA64:       # %bb.0: # %entry28; LA64-NEXT:    beqz $a0, .LBB0_229; LA64-NEXT:  # %bb.1: # %if.then30; LA64-NEXT:    csrrd $a0, 231; LA64-NEXT:    ori $a0, $a0, 132; LA64-NEXT:    csrwr $a0, 233; LA64-NEXT:  .LBB0_2: # %if.end34; LA64-NEXT:    csrrd $a0, 235; LA64-NEXT:    andi $a0, $a0, 136; LA64-NEXT:    bnez $a0, .LBB0_437; LA64-NEXT:  # %bb.3: # %if.then238; LA64-NEXT:    pcaddu18i $t8, %call36(bug)39; LA64-NEXT:    jr $t840; LA64-NEXT:  .LBB0_4: # %if.end341; LA64-NEXT:    ret42entry:43  %tobool.not = icmp eq i32 %flag, 044  br i1 %tobool.not, label %if.end, label %if.then45 46if.then:                                          ; preds = %entry47  %0 = tail call i32 @llvm.loongarch.csrrd.w(i32 2)48  %or = or i32 %0, 149  %1 = tail call i32 @llvm.loongarch.csrwr.w(i32 %or, i32 2)50  br label %if.end51 52if.end:                                           ; preds = %if.then, %entry53  %2 = tail call i32 @llvm.loongarch.csrrd.w(i32 2)54  %and = and i32 %2, 155  %tobool1.not = icmp eq i32 %and, 056  br i1 %tobool1.not, label %if.then2, label %if.end357 58if.then2:                                         ; preds = %if.end59  tail call void @bug()60  br label %if.end361 62if.end3:                                          ; preds = %if.then2, %if.end63  ret void64}65