Home | History | Annotate | Download | only in Thumb2
      1 ; RUN: llc -O3 -relocation-model=pic -mcpu=cortex-a8 -mattr=+thumb2 < %s
      2 ;
      3 ; This test creates a predicated t2ADDri instruction that is then turned into a t2MOVgpr2gpr instr.
      4 ; Test that that the predicate operands are removed properly.
      5 ;
      6 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32-n32"
      7 target triple = "thumbv7-apple-darwin10"
      8 
      9 declare void @etoe53(i16* nocapture, i16* nocapture) nounwind
     10 
     11 define void @earith(double* nocapture %value, i32 %icode, double* nocapture %r1, double* nocapture %r2) nounwind {
     12 entry:
     13   %v = alloca [6 x i16], align 4                  ; <[6 x i16]*> [#uses=1]
     14   br i1 undef, label %bb2.i, label %bb5
     15 
     16 bb2.i:                                            ; preds = %entry
     17   %0 = bitcast double* %value to i16*             ; <i16*> [#uses=1]
     18   call  void @etoe53(i16* null, i16* %0) nounwind
     19   ret void
     20 
     21 bb5:                                              ; preds = %entry
     22   switch i32 %icode, label %bb10 [
     23     i32 57, label %bb14
     24     i32 58, label %bb18
     25     i32 67, label %bb22
     26     i32 76, label %bb26
     27     i32 77, label %bb35
     28   ]
     29 
     30 bb10:                                             ; preds = %bb5
     31   br label %bb46
     32 
     33 bb14:                                             ; preds = %bb5
     34   unreachable
     35 
     36 bb18:                                             ; preds = %bb5
     37   unreachable
     38 
     39 bb22:                                             ; preds = %bb5
     40   unreachable
     41 
     42 bb26:                                             ; preds = %bb5
     43   br label %bb46
     44 
     45 bb35:                                             ; preds = %bb5
     46   unreachable
     47 
     48 bb46:                                             ; preds = %bb26, %bb10
     49   %1 = bitcast double* %value to i16*             ; <i16*> [#uses=1]
     50   %v47 = getelementptr inbounds [6 x i16], [6 x i16]* %v, i32 0, i32 0 ; <i16*> [#uses=1]
     51   call  void @etoe53(i16* %v47, i16* %1) nounwind
     52   ret void
     53 }
     54