1; RUN: llc -mcpu=a2 < %s | FileCheck %s -check-prefix=INVFUNCDESC 2; RUN: llc -mcpu=a2 -mattr=-invariant-function-descriptors < %s | FileCheck %s -check-prefix=NONINVFUNCDESC 3target datalayout = "E-m:e-i64:64-n32:64" 4target triple = "powerpc64-unknown-linux-gnu" 5 6; Function Attrs: nounwind 7define void @bar(void (...)* nocapture %x) #0 { 8entry: 9 %callee.knr.cast = bitcast void (...)* %x to void ()* 10 br label %for.body 11 12; INVFUNCDESC-LABEL: @bar 13; INVFUNCDESC-DAG: ld [[REG1:[0-9]+]], 8(3) 14; INVFUNCDESC-DAG: ld [[REG2:[0-9]+]], 16(3) 15; INVFUNCDESC-DAG: ld [[REG3:[0-9]+]], 0(3) 16 17; INVFUNCDESC: %for.body 18; INVFUNCDESC: std 2, 40(1) 19; INVFUNCDESC-DAG: mtctr [[REG3]] 20; INVFUNCDESC-DAG: mr 11, [[REG2]] 21; INVFUNCDESC-DAG: mr 2, [[REG1]] 22; INVFUNCDESC: bctrl 23; INVFUNCDESC-NEXT: ld 2, 40(1) 24 25; NONINVFUNCDESC-LABEL: @bar 26; NONINVFUNCDESC: %for.body 27; NONINVFUNCDESC: std 2, 40(1) 28; NONINVFUNCDESC-DAG: ld 3, 0(30) 29; NONINVFUNCDESC-DAG: ld 11, 16(30) 30; NONINVFUNCDESC-DAG: ld 2, 8(30) 31; NONINVFUNCDESC: mtctr 3 32; NONINVFUNCDESC: bctrl 33; NONINVFUNCDESC-NEXT: ld 2, 40(1) 34 35for.body: ; preds = %for.body, %entry 36 %i.02 = phi i32 [ 0, %entry ], [ %inc, %for.body ] 37 tail call void %callee.knr.cast() #0 38 %inc = add nuw nsw i32 %i.02, 1 39 %exitcond = icmp eq i32 %inc, 1600000000 40 br i1 %exitcond, label %for.end, label %for.body 41 42for.end: ; preds = %for.body 43 ret void 44} 45 46attributes #0 = { nounwind } 47 48