loop-form.ll 722 B

12345678910111213141516171819202122232425262728293031
  1. ; RUN: opt -S -loop-vectorize < %s | FileCheck %s
  2. target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
  3. ; Check that we vectorize only bottom-tested loops.
  4. ; This is a reduced testcase from PR21302.
  5. ;
  6. ; rdar://problem/18886083
  7. %struct.X = type { i32, i16 }
  8. ; CHECK-LABEL: @foo(
  9. ; CHECK-NOT: vector.body
  10. define void @foo(i32 %n) {
  11. entry:
  12. br label %for.cond
  13. for.cond:
  14. %i = phi i32 [ 0, %entry ], [ %inc, %for.body ]
  15. %cmp = icmp slt i32 %i, %n
  16. br i1 %cmp, label %for.body, label %if.end
  17. for.body:
  18. %iprom = sext i32 %i to i64
  19. %b = getelementptr inbounds %struct.X, %struct.X* undef, i64 %iprom, i32 1
  20. store i16 0, i16* %b, align 4
  21. %inc = add nsw i32 %i, 1
  22. br label %for.cond
  23. if.end:
  24. ret void
  25. }