1*9880d681SAndroid Build Coastguard Worker; RUN: opt -S -loop-unroll -codegenprepare < %s -domtree -analyze | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker; 3*9880d681SAndroid Build Coastguard Worker; Checks that the dom tree is properly invalidated after an operation that will 4*9880d681SAndroid Build Coastguard Worker; invalidate it in CodeGenPrepare. If the domtree isn't properly invalidated, 5*9880d681SAndroid Build Coastguard Worker; this will likely segfault, or print badref. 6*9880d681SAndroid Build Coastguard Worker 7*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: <badref> 8*9880d681SAndroid Build Coastguard Worker 9*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" 10*9880d681SAndroid Build Coastguard Workertarget triple = "armv7--linux-gnueabihf" 11*9880d681SAndroid Build Coastguard Worker 12*9880d681SAndroid Build Coastguard Workerdefine i32 @f(i32 %a) #0 { 13*9880d681SAndroid Build Coastguard Workerentry: 14*9880d681SAndroid Build Coastguard Worker br label %for.body 15*9880d681SAndroid Build Coastguard Worker 16*9880d681SAndroid Build Coastguard Workerfor.cond.cleanup: 17*9880d681SAndroid Build Coastguard Worker ret i32 %or 18*9880d681SAndroid Build Coastguard Worker 19*9880d681SAndroid Build Coastguard Workerfor.body: 20*9880d681SAndroid Build Coastguard Worker %i.08 = phi i32 [ 0, %entry ], [ %inc, %for.body ] 21*9880d681SAndroid Build Coastguard Worker %b.07 = phi i32 [ 0, %entry ], [ %or, %for.body ] 22*9880d681SAndroid Build Coastguard Worker %shr = lshr i32 %a, %i.08 23*9880d681SAndroid Build Coastguard Worker %and = and i32 %shr, 1 24*9880d681SAndroid Build Coastguard Worker %sub = sub nuw nsw i32 31, %i.08 25*9880d681SAndroid Build Coastguard Worker %shl = shl i32 %and, %sub 26*9880d681SAndroid Build Coastguard Worker %or = or i32 %shl, %b.07 27*9880d681SAndroid Build Coastguard Worker %inc = add nuw nsw i32 %i.08, 1 28*9880d681SAndroid Build Coastguard Worker %exitcond = icmp eq i32 %inc, 32 29*9880d681SAndroid Build Coastguard Worker br i1 %exitcond, label %for.cond.cleanup, label %for.body, !llvm.loop !3 30*9880d681SAndroid Build Coastguard Worker} 31*9880d681SAndroid Build Coastguard Worker 32*9880d681SAndroid Build Coastguard Workerattributes #0 = { norecurse nounwind readnone "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="cortex-a8" "target-features"="+dsp,+neon,+vfp3" "unsafe-fp-math"="false" "use-soft-float"="false" } 33*9880d681SAndroid Build Coastguard Worker 34*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!0, !1} 35*9880d681SAndroid Build Coastguard Worker!llvm.ident = !{!2} 36*9880d681SAndroid Build Coastguard Worker 37*9880d681SAndroid Build Coastguard Worker!0 = !{i32 1, !"wchar_size", i32 4} 38*9880d681SAndroid Build Coastguard Worker!1 = !{i32 1, !"min_enum_size", i32 4} 39*9880d681SAndroid Build Coastguard Worker!2 = !{!"clang version 3.8.0 (http://llvm.org/git/clang.git b7441a0f42c43a8eea9e3e706be187252db747fa)"} 40*9880d681SAndroid Build Coastguard Worker!3 = distinct !{!3, !4} 41*9880d681SAndroid Build Coastguard Worker!4 = !{!"llvm.loop.unroll.full"} 42