notify-scev.ll 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. ; RUN: opt -indvars -S %s | FileCheck %s
  2. ;
  3. ; PR18384: ValueHandleBase::ValueIsDeleted.
  4. ;
  5. ; Ensure that LoopSimplify calls ScalarEvolution::forgetLoop before
  6. ; deleting a block, regardless of whether any values were hoisted out
  7. ; of the block.
  8. target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128"
  9. target triple = "x86_64-apple-darwin"
  10. %struct.Params = type { [2 x [4 x [16 x i16]]] }
  11. ; Verify that the loop tail is deleted, and we don't crash!
  12. ;
  13. ; CHECK-LABEL: @t
  14. ; CHECK-LABEL: for.cond127.preheader:
  15. ; CHECK-NOT: for.cond127:
  16. ; CHECK-LABEL: for.body129:
  17. define void @t() {
  18. entry:
  19. br label %for.body102
  20. for.body102:
  21. br i1 undef, label %for.cond127.preheader, label %for.inc203
  22. for.cond127.preheader:
  23. br label %for.body129
  24. for.cond127:
  25. %cmp128 = icmp slt i32 %inc191, 2
  26. br i1 %cmp128, label %for.body129, label %for.end192
  27. for.body129:
  28. %uv.013 = phi i32 [ 0, %for.cond127.preheader ], [ %inc191, %for.cond127 ]
  29. %idxprom130 = sext i32 %uv.013 to i64
  30. br i1 undef, label %for.cond135.preheader.lr.ph, label %for.end185
  31. for.cond135.preheader.lr.ph:
  32. br i1 undef, label %for.cond135.preheader.lr.ph.split.us, label %for.cond135.preheader.lr.ph.split_crit_edge
  33. for.cond135.preheader.lr.ph.split_crit_edge:
  34. br label %for.cond135.preheader.lr.ph.split
  35. for.cond135.preheader.lr.ph.split.us:
  36. br label %for.cond135.preheader.us
  37. for.cond135.preheader.us:
  38. %block_y.09.us = phi i32 [ 0, %for.cond135.preheader.lr.ph.split.us ], [ %add184.us, %for.cond132.us ]
  39. br i1 true, label %for.cond138.preheader.lr.ph.us, label %for.end178.us
  40. for.end178.us:
  41. %add184.us = add nsw i32 %block_y.09.us, 4
  42. br i1 undef, label %for.end185split.us-lcssa.us, label %for.cond132.us
  43. for.end174.us:
  44. br i1 undef, label %for.cond138.preheader.us, label %for.cond135.for.end178_crit_edge.us
  45. for.inc172.us:
  46. br i1 undef, label %for.cond142.preheader.us, label %for.end174.us
  47. for.body145.us:
  48. %arrayidx163.us = getelementptr inbounds %struct.Params, %struct.Params* undef, i64 0, i32 0, i64 %idxprom130, i64 %idxprom146.us
  49. br i1 undef, label %for.body145.us, label %for.inc172.us
  50. for.cond142.preheader.us:
  51. %j.04.us = phi i32 [ %block_y.09.us, %for.cond138.preheader.us ], [ undef, %for.inc172.us ]
  52. %idxprom146.us = sext i32 %j.04.us to i64
  53. br label %for.body145.us
  54. for.cond138.preheader.us:
  55. br label %for.cond142.preheader.us
  56. for.cond132.us:
  57. br i1 undef, label %for.cond135.preheader.us, label %for.cond132.for.end185_crit_edge.us-lcssa.us
  58. for.cond138.preheader.lr.ph.us:
  59. br label %for.cond138.preheader.us
  60. for.cond135.for.end178_crit_edge.us:
  61. br label %for.end178.us
  62. for.end185split.us-lcssa.us:
  63. br label %for.end185split
  64. for.cond132.for.end185_crit_edge.us-lcssa.us:
  65. br label %for.cond132.for.end185_crit_edge
  66. for.cond135.preheader.lr.ph.split:
  67. br label %for.end185split
  68. for.end185split:
  69. br label %for.end185
  70. for.cond132.for.end185_crit_edge:
  71. br label %for.end185
  72. for.end185:
  73. %inc191 = add nsw i32 %uv.013, 1
  74. br i1 false, label %for.end192, label %for.cond127
  75. for.end192:
  76. br label %for.inc203
  77. for.inc203:
  78. br label %for.end205
  79. for.end205:
  80. ret void
  81. }