brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 3ce06f7 Raw
57 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s3 4; With optimization at O2 we actually get the legalized function optimized5; away through legalization and stack coloring, but check that we do all of6; that here and don't crash during legalization.7 8; Original program:9; typedef enum { A, B, C, D } P;10; struct { P x[2]; } a;11 12; void fn2();13; void fn1() {14;   int b;15;   unsigned c;16;   for (;; c++) {17;     fn2();18;     unsigned n;19;     for (; c; c++) {20;       b = a.x[c] == A || a.x[c] == B || a.x[c] == D;21;       if (b) n++;22;     }23;     if (n)24;       for (;;)25;       ;26;   }27; }28 29define void @fn1(i64 %a0) {30; CHECK-LABEL: fn1:31; CHECK:       # %bb.0: # %for.cond32; CHECK-NEXT:    .p2align 433; CHECK-NEXT:  .LBB0_1: # %vector.body34; CHECK-NEXT:    # =>This Inner Loop Header: Depth=135; CHECK-NEXT:    cmpq $8, %rdi36; CHECK-NEXT:    jne .LBB0_137; CHECK-NEXT:  # %bb.2: # %middle.block38; CHECK-NEXT:    retq39for.cond:40  br label %vector.body41 42vector.body:                                      ; preds = %vector.body, %for.cond43  %x42 = bitcast <4 x i4> zeroinitializer to i1644  %x43 = icmp ne i16 %x42, 045  %x44 = select i1 %x43, i32 undef, i32 046  %x72 = bitcast <4 x i1> zeroinitializer to i447  %x73 = icmp ne i4 %x72, 048  %x74 = select i1 %x73, i32 %x44, i32 undef49  %x84 = select i1 undef, i32 undef, i32 %x7450  %x88 = icmp eq i64 %a0, 851  br i1 %x88, label %middle.block, label %vector.body52 53middle.block:                                     ; preds = %vector.body54  %0 = select i1 undef, i32 undef, i32 %x8455  ret void56}57