Home | History | Annotate | Download | only in PowerPC
      1 ; RUN: llc < %s -mtriple=powerpc-apple-darwin -mcpu=g4 | FileCheck %s
      2 ; ModuleID = 'hh.c'
      3 target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128-n32"
      4 target triple = "powerpc-apple-darwin9.6"
      5 ; This formerly used R0 for both the stack address and CR.
      6 
      7 define void @foo() nounwind {
      8 entry:
      9 ;CHECK:  mfcr r2
     10 ;CHECK:  lis r3, 1
     11 ;CHECK:  rlwinm r2, r2, 8, 0, 31
     12 ;CHECK:  ori r3, r3, 34524
     13 ;CHECK:  stwx r2, r1, r3
     14 ; Make sure that the register scavenger returns the same temporary register.
     15 ;CHECK:  mfcr r2
     16 ;CHECK:  lis r3, 1
     17 ;CHECK:  rlwinm r2, r2, 12, 0, 31
     18 ;CHECK:  ori r3, r3, 34520
     19 ;CHECK:  stwx r2, r1, r3
     20   %x = alloca [100000 x i8]                       ; <[100000 x i8]*> [#uses=1]
     21   %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]
     22   %x1 = bitcast [100000 x i8]* %x to i8*          ; <i8*> [#uses=1]
     23   call void @bar(i8* %x1) nounwind
     24   call void asm sideeffect "", "~{cr2},~{cr3}"() nounwind
     25   br label %return
     26 
     27 return:                                           ; preds = %entry
     28 ;CHECK:  lis r3, 1
     29 ;CHECK:  ori r3, r3, 34524
     30 ;CHECK:  lwzx r2, r1, r3
     31 ;CHECK:  rlwinm r2, r2, 24, 0, 31
     32 ;CHECK:  mtcrf 32, r2
     33   ret void
     34 }
     35 
     36 declare void @bar(i8*)
     37