Home | History | Annotate | Download | only in Hexagon
      1 ; RUN: llc -mcpu=hexagonv4 -tail-dup-size=1 < %s | FileCheck %s
      2 
      3 target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-v64:64:64-v32:32:32-a0:0-n16:32"
      4 target triple = "hexagon-unknown--elf"
      5 
      6 ; Make sure we put the two conditionally executed adds in a packet.
      7 ; ifcnv_add:
      8 ;     {
      9 ;       p0 = cmp.gt(r2, r1)
     10 ;       if (!p0.new) r0 = add(r2, r1)
     11 ;       if (p0.new) r0 = add(r0, #10)
     12 ;     }
     13 ; CHECK: cmp
     14 ; CHECK-NEXT: add
     15 ; CHECK-NEXT: add
     16 define i32 @ifcnv_add(i32, i32, i32) nounwind readnone {
     17   %4 = icmp sgt i32 %2, %1
     18   br i1 %4, label %5, label %7
     19 
     20 ; <label>:5                                       ; preds = %3
     21   %6 = add nsw i32 %0, 10
     22   br label %9
     23 
     24 ; <label>:7                                       ; preds = %3
     25   %8 = add nsw i32 %2, %1
     26   br label %9
     27 
     28 ; <label>:9                                       ; preds = %7, %5
     29   %10 = phi i32 [ %6, %5 ], [ %8, %7 ]
     30   %11 = add nsw i32 %10, 1
     31   ret i32 %11
     32 }
     33