start-unk.ll 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. ; RUN: opt -alignment-from-assumptions -S < %s | FileCheck %s
  2. target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
  3. target triple = "x86_64-unknown-linux-gnu"
  4. %type1 = type { %type2 }
  5. %type2 = type { [4 x i8] }
  6. ; Function Attrs: nounwind
  7. declare void @llvm.assume(i1) #0
  8. ; Function Attrs: nounwind readnone
  9. declare i32 @llvm.bswap.i32(i32) #1
  10. ; Function Attrs: nounwind uwtable
  11. define void @test1() unnamed_addr #2 align 2 {
  12. ; CHECK-LABEL: @test1
  13. entry:
  14. br i1 undef, label %if.then, label %if.end
  15. if.then: ; preds = %entry
  16. unreachable
  17. if.end: ; preds = %entry
  18. br i1 undef, label %return, label %if.end8
  19. if.end8: ; preds = %if.end
  20. br i1 undef, label %if.then13, label %if.end14
  21. if.then13: ; preds = %if.end8
  22. unreachable
  23. if.end14: ; preds = %if.end8
  24. br i1 undef, label %cond.false.i129, label %cond.end.i136
  25. cond.false.i129: ; preds = %if.end14
  26. unreachable
  27. cond.end.i136: ; preds = %if.end14
  28. br i1 undef, label %land.lhs.true.i, label %if.end.i145
  29. land.lhs.true.i: ; preds = %cond.end.i136
  30. br i1 undef, label %if.end.i145, label %if.then.i137
  31. if.then.i137: ; preds = %land.lhs.true.i
  32. br i1 undef, label %cond.false8.i, label %cond.end9.i
  33. cond.false8.i: ; preds = %if.then.i137
  34. unreachable
  35. cond.end9.i: ; preds = %if.then.i137
  36. br i1 undef, label %if.then23, label %if.end24
  37. if.end.i145: ; preds = %land.lhs.true.i, %cond.end.i136
  38. unreachable
  39. if.then23: ; preds = %cond.end9.i
  40. unreachable
  41. if.end24: ; preds = %cond.end9.i
  42. br i1 undef, label %for.end, label %for.body.lr.ph
  43. for.body.lr.ph: ; preds = %if.end24
  44. unreachable
  45. for.end: ; preds = %if.end24
  46. br i1 undef, label %if.end123, label %if.then121
  47. if.then121: ; preds = %for.end
  48. unreachable
  49. if.end123: ; preds = %for.end
  50. br i1 undef, label %if.end150, label %if.then126
  51. if.then126: ; preds = %if.end123
  52. %ptrint.i.i185 = ptrtoint %type1* undef to i64
  53. %maskedptr.i.i186 = and i64 %ptrint.i.i185, 1
  54. %maskcond.i.i187 = icmp eq i64 %maskedptr.i.i186, 0
  55. tail call void @llvm.assume(i1 %maskcond.i.i187) #0
  56. %ret.0..sroa_cast.i.i188 = bitcast %type1* undef to i32*
  57. %ret.0.copyload.i.i189 = load i32, i32* %ret.0..sroa_cast.i.i188, align 2
  58. ; CHECK: load {{.*}} align 2
  59. %0 = tail call i32 @llvm.bswap.i32(i32 %ret.0.copyload.i.i189) #0
  60. %conv131 = zext i32 %0 to i64
  61. %add.ptr132 = getelementptr inbounds i8, i8* undef, i64 %conv131
  62. %1 = bitcast i8* %add.ptr132 to %type1*
  63. br i1 undef, label %if.end150, label %if.end.i173
  64. if.end.i173: ; preds = %if.then126
  65. br i1 undef, label %test1.exit, label %cond.false.i.i.i.i174
  66. cond.false.i.i.i.i174: ; preds = %if.end.i173
  67. unreachable
  68. test1.exit: ; preds = %if.end.i173
  69. br i1 undef, label %test1a.exit, label %if.end.i124
  70. if.end.i124: ; preds = %test1.exit
  71. unreachable
  72. test1a.exit: ; preds = %test1.exit
  73. br i1 undef, label %if.end150, label %for.body137.lr.ph
  74. for.body137.lr.ph: ; preds = %test1a.exit
  75. br label %for.body137
  76. for.body137: ; preds = %test1b.exit, %for.body137.lr.ph
  77. %ShndxTable.0309 = phi %type1* [ %1, %for.body137.lr.ph ], [ %incdec.ptr, %test1b.exit ]
  78. %ret.0..sroa_cast.i.i106 = bitcast %type1* %ShndxTable.0309 to i32*
  79. br i1 undef, label %for.body137.if.end146_crit_edge, label %if.then140
  80. for.body137.if.end146_crit_edge: ; preds = %for.body137
  81. %incdec.ptr = getelementptr inbounds %type1, %type1* %ShndxTable.0309, i64 1
  82. br i1 undef, label %cond.false.i70, label %cond.end.i
  83. if.then140: ; preds = %for.body137
  84. %ret.0.copyload.i.i102 = load i32, i32* %ret.0..sroa_cast.i.i106, align 2
  85. ; CHECK: load {{.*}} align 2
  86. unreachable
  87. cond.false.i70: ; preds = %for.body137.if.end146_crit_edge
  88. unreachable
  89. cond.end.i: ; preds = %for.body137.if.end146_crit_edge
  90. br i1 undef, label %test1b.exit, label %cond.false.i.i
  91. cond.false.i.i: ; preds = %cond.end.i
  92. unreachable
  93. test1b.exit: ; preds = %cond.end.i
  94. br i1 undef, label %if.end150, label %for.body137
  95. if.end150: ; preds = %test1b.exit, %test1a.exit, %if.then126, %if.end123
  96. br i1 undef, label %for.end176, label %for.body155.lr.ph
  97. for.body155.lr.ph: ; preds = %if.end150
  98. unreachable
  99. for.end176: ; preds = %if.end150
  100. unreachable
  101. return: ; preds = %if.end
  102. ret void
  103. }
  104. attributes #0 = { nounwind }
  105. attributes #1 = { nounwind readnone }
  106. attributes #2 = { nounwind uwtable }