divide-pointer.ll 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. ; RUN: opt < %s -indvars
  2. ; PR4271
  3. target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
  4. target triple = "i386-apple-darwin10.0"
  5. %struct.xyz = type <{ i64, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, [8 x i8], i64, i64, i32, i32, [4 x i32], i32, i32, i32, i32, i32, i32, [76 x i32], i32, [2 x %struct.uvw] }>
  6. %struct.uvw = type <{ i64, i64 }>
  7. define i32 @foo(%struct.xyz* %header, i8* %p2, i8* %p3, i8* nocapture %p4) nounwind {
  8. entry:
  9. br label %while.body.i
  10. while.body.i: ; preds = %while.body.i, %entry
  11. br i1 undef, label %while.body.i, label %bcopy_internal.exit
  12. bcopy_internal.exit: ; preds = %while.body.i
  13. %conv135 = ptrtoint %struct.xyz* %header to i32 ; <i32> [#uses=1]
  14. %shr136 = lshr i32 %conv135, 12 ; <i32> [#uses=1]
  15. br label %for.body
  16. for.body: ; preds = %for.body, %bcopy_internal.exit
  17. %ppnum.052 = phi i32 [ %inc, %for.body ], [ %shr136, %bcopy_internal.exit ] ; <i32> [#uses=1]
  18. %inc = add i32 %ppnum.052, 1 ; <i32> [#uses=2]
  19. %cmp = icmp ugt i32 %inc, undef ; <i1> [#uses=1]
  20. br i1 %cmp, label %if.then199, label %for.body
  21. if.then199: ; preds = %if.then199, %for.body
  22. br label %if.then199
  23. }
  24. define i32 @same_thing_but_signed(%struct.xyz* %header, i8* %p2, i8* %p3, i8* nocapture %p4) nounwind {
  25. entry:
  26. br label %while.body.i
  27. while.body.i: ; preds = %while.body.i, %entry
  28. br i1 undef, label %while.body.i, label %bcopy_internal.exit
  29. bcopy_internal.exit: ; preds = %while.body.i
  30. %conv135 = ptrtoint %struct.xyz* %header to i32 ; <i32> [#uses=1]
  31. %shr136 = ashr i32 %conv135, 12 ; <i32> [#uses=1]
  32. br label %for.body
  33. for.body: ; preds = %for.body, %bcopy_internal.exit
  34. %ppnum.052 = phi i32 [ %inc, %for.body ], [ %shr136, %bcopy_internal.exit ] ; <i32> [#uses=1]
  35. %inc = add i32 %ppnum.052, 1 ; <i32> [#uses=2]
  36. %cmp = icmp ugt i32 %inc, undef ; <i1> [#uses=1]
  37. br i1 %cmp, label %if.then199, label %for.body
  38. if.then199: ; preds = %if.then199, %for.body
  39. br label %if.then199
  40. }
  41. define i32 @same_thing_but_multiplied(%struct.xyz* %header, i8* %p2, i8* %p3, i8* nocapture %p4) nounwind {
  42. entry:
  43. br label %while.body.i
  44. while.body.i: ; preds = %while.body.i, %entry
  45. br i1 undef, label %while.body.i, label %bcopy_internal.exit
  46. bcopy_internal.exit: ; preds = %while.body.i
  47. %conv135 = ptrtoint %struct.xyz* %header to i32 ; <i32> [#uses=1]
  48. %shr136 = shl i32 %conv135, 12 ; <i32> [#uses=1]
  49. br label %for.body
  50. for.body: ; preds = %for.body, %bcopy_internal.exit
  51. %ppnum.052 = phi i32 [ %inc, %for.body ], [ %shr136, %bcopy_internal.exit ] ; <i32> [#uses=1]
  52. %inc = add i32 %ppnum.052, 1 ; <i32> [#uses=2]
  53. %cmp = icmp ugt i32 %inc, undef ; <i1> [#uses=1]
  54. br i1 %cmp, label %if.then199, label %for.body
  55. if.then199: ; preds = %if.then199, %for.body
  56. br label %if.then199
  57. }
  58. define i32 @same_thing_but_xored(%struct.xyz* %header, i8* %p2, i8* %p3, i8* nocapture %p4) nounwind {
  59. entry:
  60. br label %while.body.i
  61. while.body.i: ; preds = %while.body.i, %entry
  62. br i1 undef, label %while.body.i, label %bcopy_internal.exit
  63. bcopy_internal.exit: ; preds = %while.body.i
  64. %conv135 = ptrtoint %struct.xyz* %header to i32 ; <i32> [#uses=1]
  65. %shr136 = xor i32 %conv135, 12 ; <i32> [#uses=1]
  66. br label %for.body
  67. for.body: ; preds = %for.body, %bcopy_internal.exit
  68. %ppnum.052 = phi i32 [ %inc, %for.body ], [ %shr136, %bcopy_internal.exit ] ; <i32> [#uses=1]
  69. %inc = add i32 %ppnum.052, 1 ; <i32> [#uses=2]
  70. %cmp = icmp ugt i32 %inc, undef ; <i1> [#uses=1]
  71. br i1 %cmp, label %if.then199, label %for.body
  72. if.then199: ; preds = %if.then199, %for.body
  73. br label %if.then199
  74. }