brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.2 KiB · b0eeadf Raw
96 lines · plain
1; RUN: llc -mtriple=mips -mcpu=mips32r6 -O1 -start-after=dwarf-eh-prepare < %s | FileCheck %s2; RUN: llc -mtriple=mips64 -mcpu=mips64r6 -O1 -start-after=dwarf-eh-prepare < %s | FileCheck %s3 4 5; beqc/bnec have the constraint that $rs < $rt && $rs != 0 && $rt != 06; Cases where $rs == 0 and $rt != 0 should be transformed into beqzc/bnezc.7; Cases where $rs > $rt can have the operands swapped as ==,!= are commutative.8 9; Cases where beq & bne where $rs == $rt have to inhibited from being turned10; into compact branches but arguably should not occur. This test covers the11; $rs == $rt case.12 13; Starting from dwarf exception handling preparation skips optimizations that14; may simplify out the crucical bnec $4, $4 instruction.15 16define internal void @_ZL14TestRemoveLastv(ptr %alist.sroa.0.4) {17; CHECK-LABEL: _ZL14TestRemoveLastv:18entry:19  %ascevgep = getelementptr i32, ptr %alist.sroa.0.4, i64 9920  br label %do.body12121 22for.cond117:23  %alsr.iv.next = add nsw i32 %alsr.iv, -124  %ascevgep340 = getelementptr i32, ptr %alsr.iv339, i64 -125  %acmp118 = icmp sgt i32 %alsr.iv.next, 026  br i1 %acmp118, label %do.body121, label %if.then14327 28do.body121:29  %alsr.iv339 = phi ptr [ %ascevgep, %entry ], [ %ascevgep340, %for.cond117 ]30  %alsr.iv = phi i32 [ 100, %entry ], [ %alsr.iv.next, %for.cond117 ]31  %a9 = add i32 %alsr.iv, -132  %alnot124 = icmp eq i32 %alsr.iv, %alsr.iv33  br i1 %alnot124, label %do.body134, label %if.then143, !prof !1134 35do.body134:36  %a10 = add i32 %alsr.iv, -137  %a11 = load i32, ptr %alsr.iv339, align 4, !tbaa !538; CHECK-NOT: bnec $[[R0:[0-9]+]], $[[R0]]39; CHECK-NOT: beqc $[[R1:[0-9]+]], $[[R1]]40  %alnot137 = icmp eq i32 %a9, %a1141  br i1 %alnot137, label %do.end146, label %if.then143, !prof !1142 43if.then143:44 ret void45 unreachable46 47do.end146:48  %alnot151 = icmp eq i32 %a9, %a1049  br i1 %alnot151, label %for.cond117, label %if.then143, !prof !1150 51}52 53define internal void @_ZL14TestRemoveLastv64(ptr %alist.sroa.0.4) {54; CHECK-LABEL: _ZL14TestRemoveLastv64:55entry:56  %ascevgep = getelementptr i64, ptr %alist.sroa.0.4, i64 9957  br label %do.body12158 59for.cond117:60  %alsr.iv.next = add nsw i64 %alsr.iv, -161  %ascevgep340 = getelementptr i64, ptr %alsr.iv339, i64 -162  %acmp118 = icmp sgt i64 %alsr.iv.next, 063  br i1 %acmp118, label %do.body121, label %if.then14364 65do.body121:66  %alsr.iv339 = phi ptr [ %ascevgep, %entry ], [ %ascevgep340, %for.cond117 ]67  %alsr.iv = phi i64 [ 100, %entry ], [ %alsr.iv.next, %for.cond117 ]68  %a9 = add i64 %alsr.iv, -169  %alnot124 = icmp eq i64 %alsr.iv, %alsr.iv70  br i1 %alnot124, label %do.body134, label %if.then143, !prof !1171 72do.body134:73  %a10 = add i64 %alsr.iv, -174  %a11 = load i64, ptr %alsr.iv339, align 4, !tbaa !575; CHECK-NOT: bnec $[[R0:[0-9]+]], $[[R0]]76; CHECK-NOT: beqc $[[R1:[0-9]+]], $[[R1]]77  %alnot137 = icmp eq i64 %a9, %a1178  br i1 %alnot137, label %do.end146, label %if.then143, !prof !1179 80if.then143:81 ret void82 unreachable83 84do.end146:85  %alnot151 = icmp eq i64 %a9, %a1086  br i1 %alnot151, label %for.cond117, label %if.then143, !prof !1187 88}89!3 = !{!"omnipotent char", !4, i64 0}90!4 = !{!"Simple C++ TBAA"}91!5 = !{!6, !6, i64 0}92!6 = !{!"int", !3, i64 0}93!11 = !{!"branch_weights", i32 2000, i32 1}94!12 = !{!"branch_weights", i32 -388717296, i32 7818360}95 96