Home | History | Annotate | Download | only in Hexagon
      1 ; RUN: llc -march=hexagon < %s | FileCheck %s
      2 ; This testcase used to fail with "cannot select 'i1 = add x, y'".
      3 ; Check for some sane output:
      4 ; CHECK: xor(p{{[0-3]}},p{{[0-3]}})
      5 
      6 target datalayout = "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048"
      7 target triple = "hexagon"
      8 
      9 define void @foo(i32* nocapture %a0) local_unnamed_addr #0 {
     10 b1:
     11   %v2 = getelementptr inbounds i32, i32* %a0, i32 26
     12   %v3 = load i32, i32* %v2, align 4
     13   %v4 = add nsw i32 %v3, 1
     14   %v5 = load i32, i32* %a0, align 4
     15   br label %b6
     16 
     17 b6:                                               ; preds = %b28, %b1
     18   %v7 = phi i32 [ %v29, %b28 ], [ %v5, %b1 ]
     19   %v8 = mul nsw i32 %v4, %v7
     20   %v9 = add nsw i32 %v8, %v7
     21   %v10 = mul i32 %v7, %v7
     22   %v11 = mul i32 %v10, %v9
     23   %v12 = add nsw i32 %v11, 1
     24   %v13 = mul nsw i32 %v12, %v7
     25   %v14 = add nsw i32 %v13, %v7
     26   %v15 = mul i32 %v10, %v14
     27   %v16 = and i32 %v15, 1
     28   %v17 = add nsw i32 %v16, -1
     29   %v18 = mul i32 %v10, %v7
     30   %v19 = mul i32 %v18, %v11
     31   %v20 = mul i32 %v19, %v17
     32   %v21 = and i32 %v20, 1
     33   %v22 = add nsw i32 %v21, -1
     34   %v23 = mul nsw i32 %v22, %v3
     35   %v24 = sub nsw i32 %v7, %v23
     36   %v25 = mul i32 %v10, %v24
     37   %v26 = sub i32 0, %v7
     38   %v27 = icmp eq i32 %v25, %v26
     39   br i1 %v27, label %b30, label %b28
     40 
     41 b28:                                              ; preds = %b6
     42   %v29 = add nsw i32 %v3, %v7
     43   store i32 %v29, i32* %a0, align 4
     44   br label %b6
     45 
     46 b30:                                              ; preds = %b6
     47   ret void
     48 }
     49 
     50 attributes #0 = { norecurse nounwind "target-cpu"="hexagonv60" }
     51