1; RUN: llc -verify-machineinstrs -mcpu=a2 < %s | FileCheck %s -check-prefix=INVFUNCDESC 2; RUN: llc -verify-machineinstrs -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-DAG: mtctr [[REG3]] 19; INVFUNCDESC-DAG: mr 11, [[REG2]] 20; INVFUNCDESC-DAG: mr 2, [[REG1]] 21; INVFUNCDESC: bctrl 22; INVFUNCDESC-NEXT: ld 2, 40(1) 23 24; NONINVFUNCDESC-LABEL: @bar 25; NONINVFUNCDESC: %for.body 26; NONINVFUNCDESC-DAG: ld 3, 0(30) 27; NONINVFUNCDESC-DAG: ld 11, 16(30) 28; NONINVFUNCDESC-DAG: ld 2, 8(30) 29; NONINVFUNCDESC: mtctr 3 30; NONINVFUNCDESC: bctrl 31; NONINVFUNCDESC-NEXT: ld 2, 40(1) 32 33for.body: ; preds = %for.body, %entry 34 %i.02 = phi i32 [ 0, %entry ], [ %inc, %for.body ] 35 tail call void %callee.knr.cast() #0 36 %inc = add nuw nsw i32 %i.02, 1 37 %exitcond = icmp eq i32 %inc, 1600000000 38 br i1 %exitcond, label %for.end, label %for.body 39 40for.end: ; preds = %for.body 41 ret void 42} 43 44attributes #0 = { nounwind } 45 46