1eee6a45aSFangrui Song; REQUIRES: arm-registered-target 2*68726318SArthur Eubanks; RUN: opt -S -loop-unroll -codegenprepare < %s -domtree -verify-dom-info | FileCheck %s 3cee313d2SEric Christopher; 4cee313d2SEric Christopher; Checks that the dom tree is properly invalidated after an operation that will 5cee313d2SEric Christopher; invalidate it in CodeGenPrepare. If the domtree isn't properly invalidated, 6cee313d2SEric Christopher; this will likely segfault, or print badref. 7cee313d2SEric Christopher 8*68726318SArthur Eubanks; CHECK: @f 9cee313d2SEric Christopher 10cee313d2SEric Christophertarget datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" 11cee313d2SEric Christophertarget triple = "armv7--linux-gnueabihf" 12cee313d2SEric Christopher 13cee313d2SEric Christopherdefine i32 @f(i32 %a) #0 { 14cee313d2SEric Christopherentry: 15cee313d2SEric Christopher br label %for.body 16cee313d2SEric Christopher 17cee313d2SEric Christopherfor.cond.cleanup: 18cee313d2SEric Christopher ret i32 %or 19cee313d2SEric Christopher 20cee313d2SEric Christopherfor.body: 21cee313d2SEric Christopher %i.08 = phi i32 [ 0, %entry ], [ %inc, %for.body ] 22cee313d2SEric Christopher %b.07 = phi i32 [ 0, %entry ], [ %or, %for.body ] 23cee313d2SEric Christopher %shr = lshr i32 %a, %i.08 24cee313d2SEric Christopher %and = and i32 %shr, 1 25cee313d2SEric Christopher %sub = sub nuw nsw i32 31, %i.08 26cee313d2SEric Christopher %shl = shl i32 %and, %sub 27cee313d2SEric Christopher %or = or i32 %shl, %b.07 28cee313d2SEric Christopher %inc = add nuw nsw i32 %i.08, 1 29cee313d2SEric Christopher %exitcond = icmp eq i32 %inc, 32 30cee313d2SEric Christopher br i1 %exitcond, label %for.cond.cleanup, label %for.body, !llvm.loop !3 31cee313d2SEric Christopher} 32cee313d2SEric Christopher 334ab3041aSserge-sans-pailleattributes #0 = { norecurse nounwind readnone "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "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" } 34cee313d2SEric Christopher 35cee313d2SEric Christopher!llvm.module.flags = !{!0, !1} 36cee313d2SEric Christopher!llvm.ident = !{!2} 37cee313d2SEric Christopher 38cee313d2SEric Christopher!0 = !{i32 1, !"wchar_size", i32 4} 39cee313d2SEric Christopher!1 = !{i32 1, !"min_enum_size", i32 4} 40cee313d2SEric Christopher!2 = !{!"clang version 3.8.0"} 41cee313d2SEric Christopher!3 = distinct !{!3, !4} 42cee313d2SEric Christopher!4 = !{!"llvm.loop.unroll.full"} 43