iv-widen.ll 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ; RUN: opt < %s -indvars -S | FileCheck %s
  2. ; Provide legal integer types.
  3. target datalayout = "n8:16:32:64"
  4. target triple = "x86_64-apple-darwin"
  5. ; CHECK-LABEL: @sloop
  6. ; CHECK-LABEL: B18:
  7. ; Only one phi now.
  8. ; CHECK: phi
  9. ; CHECK-NOT: phi
  10. ; One trunc for the gep.
  11. ; CHECK: trunc i64 %indvars.iv to i32
  12. ; One trunc for the dummy() call.
  13. ; CHECK-LABEL: exit24:
  14. ; CHECK: trunc i64 {{.*}}lcssa.wide to i32
  15. define void @sloop(i32* %a) {
  16. Prologue:
  17. br i1 undef, label %B18, label %B6
  18. B18: ; preds = %B24, %Prologue
  19. %.02 = phi i32 [ 0, %Prologue ], [ %tmp33, %B24 ]
  20. %tmp23 = zext i32 %.02 to i64
  21. %tmp33 = add i32 %.02, 1
  22. %o = getelementptr i32, i32* %a, i32 %.02
  23. %v = load i32, i32* %o
  24. %t = icmp eq i32 %v, 0
  25. br i1 %t, label %exit24, label %B24
  26. B24: ; preds = %B18
  27. %t2 = icmp eq i32 %tmp33, 20
  28. br i1 %t2, label %B6, label %B18
  29. B6: ; preds = %Prologue
  30. ret void
  31. exit24: ; preds = %B18
  32. call void @dummy(i32 %.02)
  33. unreachable
  34. }
  35. declare void @dummy(i32)