Home | History | Annotate | Download | only in Hexagon
      1 ; RUN: llc -march=hexagon -O3 -verify-machineinstrs < %s | FileCheck %s
      2 ;
      3 ; Check that this testcase compiles successfully and that a new-value jump
      4 ; has been created.
      5 ; CHECK: if (cmp.gtu(r{{[0-9]+}}.new,r{{[0-9]+}})) jump
      6 
      7 target triple = "hexagon"
      8 
      9 @g0 = external hidden unnamed_addr global [182 x i16], align 8
     10 
     11 define void @fred(i16 signext %a0, i16 signext %a1) #0 {
     12 b1:
     13   %v1 = sext i16 %a0 to i32
     14   %v2 = getelementptr inbounds [182 x i16], [182 x i16]* @g0, i32 0, i32 %v1
     15   %v3 = sext i16 %a1 to i32
     16   %v4 = call i32 @llvm.hexagon.A2.asrh(i32 undef)
     17   %v5 = trunc i32 %v4 to i16
     18   br i1 undef, label %b6, label %b14
     19 
     20 b6:                                               ; preds = %b1
     21   %v7 = sext i16 %v5 to i32
     22   br label %b8
     23 
     24 b8:                                               ; preds = %b8, %b6
     25   %v9 = phi i32 [ 128, %b6 ], [ %v13, %b8 ]
     26   %v10 = sub nsw i32 %v9, %v7
     27   %v11 = getelementptr inbounds [182 x i16], [182 x i16]* @g0, i32 0, i32 %v10
     28   %v12 = load i16, i16* %v11, align 2
     29   %v13 = add nuw nsw i32 %v9, 1
     30   br label %b8
     31 
     32 b14:                                              ; preds = %b1
     33   br i1 undef, label %b16, label %b15
     34 
     35 b15:                                              ; preds = %b14
     36   unreachable
     37 
     38 b16:                                              ; preds = %b14
     39   %v17 = getelementptr [182 x i16], [182 x i16]* @g0, i32 0, i32 %v3
     40   %v18 = icmp ugt i16* %v17, %v2
     41   %v19 = or i1 %v18, undef
     42   br i1 %v19, label %b20, label %b21
     43 
     44 b20:                                              ; preds = %b16
     45   unreachable
     46 
     47 b21:                                              ; preds = %b16
     48   ret void
     49 }
     50 
     51 declare i32 @llvm.hexagon.A2.asrh(i32) #1
     52 
     53 attributes #0 = { nounwind "target-cpu"="hexagonv62" }
     54 attributes #1 = { nounwind readnone }
     55