2012-03-26-constexpr.ll 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. ; RUN: opt < %s -loop-reduce -S
  2. ; PR11950: isHighCostExpansion crashes on ConstExpr
  3. ;
  4. ; The crash happened during IVChain analysis (CollectChains). We don't
  5. ; really care how LSR decides to transform this loop, so we don't
  6. ; check it. As long as the analysis doesn't crash we're ok.
  7. target datalayout = "e-p:64:64:64-n32:64"
  8. %struct.this_structure_s.0.5 = type { [6144 x [8 x i32]], [6144 x [8 x i32]], [6147 x [4 x i32]], [8 x i32], [2 x i8*], [2 x i8*], [6144 x i8], [6144 x i32], [6144 x i32], [4 x [4 x i8]] }
  9. define internal fastcc void @someFunction(%struct.this_structure_s.0.5* nocapture %scratch, i32 %stage, i32 %cbSize) nounwind {
  10. entry:
  11. %0 = getelementptr inbounds %struct.this_structure_s.0.5, %struct.this_structure_s.0.5* %scratch, i32 0, i32 4, i32 %stage
  12. %1 = load i8*, i8** %0, align 4
  13. %2 = getelementptr inbounds %struct.this_structure_s.0.5, %struct.this_structure_s.0.5* %scratch, i32 0, i32 5, i32 %stage
  14. %3 = load i8*, i8** %2, align 4
  15. %4 = getelementptr inbounds %struct.this_structure_s.0.5, %struct.this_structure_s.0.5* %scratch, i32 0, i32 2, i32 0, i32 0
  16. %tmp11 = shl i32 %stage, 1
  17. %tmp1325 = or i32 %tmp11, 1
  18. br label %__label_D_1608
  19. __label_D_1608: ; preds = %__label_D_1608, %entry
  20. %i.12 = phi i32 [ 0, %entry ], [ %10, %__label_D_1608 ]
  21. %tmp = shl i32 %i.12, 2
  22. %lvar_g.13 = getelementptr i32, i32* %4, i32 %tmp
  23. %tmp626 = or i32 %tmp, 1
  24. %scevgep = getelementptr i32, i32* %4, i32 %tmp626
  25. %tmp727 = or i32 %tmp, 2
  26. %scevgep8 = getelementptr i32, i32* %4, i32 %tmp727
  27. %tmp928 = or i32 %tmp, 3
  28. %scevgep10 = getelementptr i32, i32* %4, i32 %tmp928
  29. %scevgep12 = getelementptr %struct.this_structure_s.0.5, %struct.this_structure_s.0.5* %scratch, i32 0, i32 9, i32 %tmp11, i32 %i.12
  30. %scevgep14 = getelementptr %struct.this_structure_s.0.5, %struct.this_structure_s.0.5* %scratch, i32 0, i32 9, i32 %tmp1325, i32 %i.12
  31. %5 = load i8, i8* %scevgep12, align 1
  32. %6 = sext i8 %5 to i32
  33. %7 = load i8, i8* %scevgep14, align 1
  34. %8 = sext i8 %7 to i32
  35. store i32 0, i32* %lvar_g.13, align 4
  36. store i32 %8, i32* %scevgep, align 4
  37. store i32 %6, i32* %scevgep8, align 4
  38. %9 = add nsw i32 %8, %6
  39. store i32 %9, i32* %scevgep10, align 4
  40. %10 = add nsw i32 %i.12, 1
  41. %exitcond = icmp eq i32 %10, 3
  42. br i1 %exitcond, label %return, label %__label_D_1608
  43. return: ; preds = %__label_D_1608
  44. ret void
  45. }