unhandled.ll 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. ; RUN: opt -irce-print-changed-loops -irce -S < %s 2>&1 | FileCheck %s
  2. ; Demonstrates that we don't currently handle the general expression
  3. ; `A * I + B'.
  4. define void @general_affine_expressions(i32 *%arr, i32 *%a_len_ptr, i32 %n,
  5. i32 %scale, i32 %offset) {
  6. ; CHECK-NOT: constrained Loop at depth
  7. entry:
  8. %len = load i32, i32* %a_len_ptr, !range !0
  9. %first.itr.check = icmp sgt i32 %n, 0
  10. br i1 %first.itr.check, label %loop, label %exit
  11. loop:
  12. %idx = phi i32 [ 0, %entry ] , [ %idx.next, %in.bounds ]
  13. %idx.next = add i32 %idx, 1
  14. %idx.mul = mul i32 %idx, %scale
  15. %array.idx = add i32 %idx.mul, %offset
  16. %abc.high = icmp slt i32 %array.idx, %len
  17. %abc.low = icmp sge i32 %array.idx, 0
  18. %abc = and i1 %abc.low, %abc.high
  19. br i1 %abc, label %in.bounds, label %out.of.bounds
  20. in.bounds:
  21. %addr = getelementptr i32, i32* %arr, i32 %array.idx
  22. store i32 0, i32* %addr
  23. %next = icmp slt i32 %idx.next, %n
  24. br i1 %next, label %loop, label %exit
  25. out.of.bounds:
  26. ret void
  27. exit:
  28. ret void
  29. }
  30. !0 = !{i32 0, i32 2147483647}