sh-rec3.ll 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
  2. target triple = "x86_64-unknown-linux-gnu"
  3. ; RUN: opt < %s -basicaa -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 -bb-vectorize -S | FileCheck %s
  4. %struct.gsm_state.2.8.39.44.45.55.56.57.58.59.62.63.64.65.74.75.76.77.80.87.92.93.94.95.96.97.110.111.112.113.114.128.130.135.136.137.138.139.140.141.142.143.144.145.148.149.150.151.152.169.170.177.178.179.184.185.186.187.188.201.208.209.219.220.221.223.224.225.230.231.232.233.235.236.237.238.245.246.248.249.272.274.279.280.281.282.283.286.293.298.299.314.315.316.317.318.319.320.321.322.323.324.325.326.327.328.329.330.331.332.333.334.335.336.337.338.339.340.341.342.343.344.345.346.347.348.349.350.351.352.353.565 = type { [280 x i16], i16, i64, i32, [8 x i16], [2 x [8 x i16]], i16, i16, [9 x i16], i16, i8, i8 }
  5. define void @gsm_encode(%struct.gsm_state.2.8.39.44.45.55.56.57.58.59.62.63.64.65.74.75.76.77.80.87.92.93.94.95.96.97.110.111.112.113.114.128.130.135.136.137.138.139.140.141.142.143.144.145.148.149.150.151.152.169.170.177.178.179.184.185.186.187.188.201.208.209.219.220.221.223.224.225.230.231.232.233.235.236.237.238.245.246.248.249.272.274.279.280.281.282.283.286.293.298.299.314.315.316.317.318.319.320.321.322.323.324.325.326.327.328.329.330.331.332.333.334.335.336.337.338.339.340.341.342.343.344.345.346.347.348.349.350.351.352.353.565* %s, i16* %source, i8* %c) nounwind uwtable {
  6. entry:
  7. %LARc28 = alloca [2 x i64], align 16
  8. %LARc28.sub = getelementptr inbounds [2 x i64], [2 x i64]* %LARc28, i64 0, i64 0
  9. %tmpcast = bitcast [2 x i64]* %LARc28 to [8 x i16]*
  10. %Nc = alloca [4 x i16], align 2
  11. %Mc = alloca [4 x i16], align 2
  12. %bc = alloca [4 x i16], align 2
  13. %xmc = alloca [52 x i16], align 16
  14. %arraydecay = bitcast [2 x i64]* %LARc28 to i16*
  15. %arraydecay1 = getelementptr inbounds [4 x i16], [4 x i16]* %Nc, i64 0, i64 0
  16. %arraydecay2 = getelementptr inbounds [4 x i16], [4 x i16]* %bc, i64 0, i64 0
  17. %arraydecay3 = getelementptr inbounds [4 x i16], [4 x i16]* %Mc, i64 0, i64 0
  18. %arraydecay5 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 0
  19. call void @Gsm_Coder(%struct.gsm_state.2.8.39.44.45.55.56.57.58.59.62.63.64.65.74.75.76.77.80.87.92.93.94.95.96.97.110.111.112.113.114.128.130.135.136.137.138.139.140.141.142.143.144.145.148.149.150.151.152.169.170.177.178.179.184.185.186.187.188.201.208.209.219.220.221.223.224.225.230.231.232.233.235.236.237.238.245.246.248.249.272.274.279.280.281.282.283.286.293.298.299.314.315.316.317.318.319.320.321.322.323.324.325.326.327.328.329.330.331.332.333.334.335.336.337.338.339.340.341.342.343.344.345.346.347.348.349.350.351.352.353.565* %s, i16* %source, i16* %arraydecay, i16* %arraydecay1, i16* %arraydecay2, i16* %arraydecay3, i16* undef, i16* %arraydecay5) nounwind
  20. %0 = load i64, i64* %LARc28.sub, align 16
  21. %1 = trunc i64 %0 to i32
  22. %conv1 = lshr i32 %1, 2
  23. %and = and i32 %conv1, 15
  24. %or = or i32 %and, 208
  25. %conv6 = trunc i32 %or to i8
  26. %incdec.ptr = getelementptr inbounds i8, i8* %c, i64 1
  27. store i8 %conv6, i8* %c, align 1
  28. %conv84 = trunc i64 %0 to i8
  29. %and9 = shl i8 %conv84, 6
  30. %incdec.ptr15 = getelementptr inbounds i8, i8* %c, i64 2
  31. store i8 %and9, i8* %incdec.ptr, align 1
  32. %2 = lshr i64 %0, 50
  33. %shr226.tr = trunc i64 %2 to i8
  34. %conv25 = and i8 %shr226.tr, 7
  35. %incdec.ptr26 = getelementptr inbounds i8, i8* %c, i64 3
  36. store i8 %conv25, i8* %incdec.ptr15, align 1
  37. %incdec.ptr42 = getelementptr inbounds i8, i8* %c, i64 4
  38. store i8 0, i8* %incdec.ptr26, align 1
  39. %arrayidx52 = getelementptr inbounds [8 x i16], [8 x i16]* %tmpcast, i64 0, i64 7
  40. %3 = load i16, i16* %arrayidx52, align 2
  41. %conv537 = trunc i16 %3 to i8
  42. %and54 = and i8 %conv537, 7
  43. %incdec.ptr57 = getelementptr inbounds i8, i8* %c, i64 5
  44. store i8 %and54, i8* %incdec.ptr42, align 1
  45. %incdec.ptr68 = getelementptr inbounds i8, i8* %c, i64 6
  46. store i8 0, i8* %incdec.ptr57, align 1
  47. %4 = load i16, i16* %arraydecay3, align 2
  48. %conv748 = trunc i16 %4 to i8
  49. %and75 = shl i8 %conv748, 5
  50. %shl76 = and i8 %and75, 96
  51. %incdec.ptr84 = getelementptr inbounds i8, i8* %c, i64 7
  52. store i8 %shl76, i8* %incdec.ptr68, align 1
  53. %arrayidx94 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 1
  54. %5 = load i16, i16* %arrayidx94, align 2
  55. %conv959 = trunc i16 %5 to i8
  56. %and96 = shl i8 %conv959, 1
  57. %shl97 = and i8 %and96, 14
  58. %or103 = or i8 %shl97, 1
  59. %incdec.ptr105 = getelementptr inbounds i8, i8* %c, i64 8
  60. store i8 %or103, i8* %incdec.ptr84, align 1
  61. %arrayidx115 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 4
  62. %6 = bitcast i16* %arrayidx115 to i32*
  63. %7 = load i32, i32* %6, align 8
  64. %conv11610 = trunc i32 %7 to i8
  65. %and117 = and i8 %conv11610, 7
  66. %incdec.ptr120 = getelementptr inbounds i8, i8* %c, i64 9
  67. store i8 %and117, i8* %incdec.ptr105, align 1
  68. %8 = lshr i32 %7, 16
  69. %and12330 = shl nuw nsw i32 %8, 5
  70. %and123 = trunc i32 %and12330 to i8
  71. %incdec.ptr136 = getelementptr inbounds i8, i8* %c, i64 10
  72. store i8 %and123, i8* %incdec.ptr120, align 1
  73. %incdec.ptr157 = getelementptr inbounds i8, i8* %c, i64 11
  74. store i8 0, i8* %incdec.ptr136, align 1
  75. %incdec.ptr172 = getelementptr inbounds i8, i8* %c, i64 12
  76. store i8 0, i8* %incdec.ptr157, align 1
  77. %arrayidx173 = getelementptr inbounds [4 x i16], [4 x i16]* %Nc, i64 0, i64 1
  78. %9 = load i16, i16* %arrayidx173, align 2
  79. %conv17412 = zext i16 %9 to i32
  80. %and175 = shl nuw nsw i32 %conv17412, 1
  81. %arrayidx177 = getelementptr inbounds [4 x i16], [4 x i16]* %bc, i64 0, i64 1
  82. %10 = load i16, i16* %arrayidx177, align 2
  83. %conv17826 = zext i16 %10 to i32
  84. %shr17913 = lshr i32 %conv17826, 1
  85. %and180 = and i32 %shr17913, 1
  86. %or181 = or i32 %and175, %and180
  87. %conv182 = trunc i32 %or181 to i8
  88. %incdec.ptr183 = getelementptr inbounds i8, i8* %c, i64 13
  89. store i8 %conv182, i8* %incdec.ptr172, align 1
  90. %arrayidx188 = getelementptr inbounds [4 x i16], [4 x i16]* %Mc, i64 0, i64 1
  91. %11 = load i16, i16* %arrayidx188, align 2
  92. %conv18914 = trunc i16 %11 to i8
  93. %and190 = shl i8 %conv18914, 5
  94. %shl191 = and i8 %and190, 96
  95. %incdec.ptr199 = getelementptr inbounds i8, i8* %c, i64 14
  96. store i8 %shl191, i8* %incdec.ptr183, align 1
  97. %arrayidx209 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 14
  98. %12 = load i16, i16* %arrayidx209, align 4
  99. %conv21015 = trunc i16 %12 to i8
  100. %and211 = shl i8 %conv21015, 1
  101. %shl212 = and i8 %and211, 14
  102. %or218 = or i8 %shl212, 1
  103. %incdec.ptr220 = getelementptr inbounds i8, i8* %c, i64 15
  104. store i8 %or218, i8* %incdec.ptr199, align 1
  105. %arrayidx225 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 16
  106. %13 = bitcast i16* %arrayidx225 to i64*
  107. %14 = load i64, i64* %13, align 16
  108. %conv22616 = trunc i64 %14 to i8
  109. %and227 = shl i8 %conv22616, 3
  110. %shl228 = and i8 %and227, 56
  111. %incdec.ptr235 = getelementptr inbounds i8, i8* %c, i64 16
  112. store i8 %shl228, i8* %incdec.ptr220, align 1
  113. %15 = lshr i64 %14, 32
  114. %and23832 = shl nuw nsw i64 %15, 5
  115. %and238 = trunc i64 %and23832 to i8
  116. %incdec.ptr251 = getelementptr inbounds i8, i8* %c, i64 17
  117. store i8 %and238, i8* %incdec.ptr235, align 1
  118. %arrayidx266 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 23
  119. %incdec.ptr272 = getelementptr inbounds i8, i8* %c, i64 18
  120. store i8 0, i8* %incdec.ptr251, align 1
  121. %16 = load i16, i16* %arrayidx266, align 2
  122. %conv27418 = trunc i16 %16 to i8
  123. %and275 = shl i8 %conv27418, 6
  124. %incdec.ptr287 = getelementptr inbounds i8, i8* %c, i64 19
  125. store i8 %and275, i8* %incdec.ptr272, align 1
  126. %arrayidx288 = getelementptr inbounds [4 x i16], [4 x i16]* %Nc, i64 0, i64 2
  127. %17 = load i16, i16* %arrayidx288, align 2
  128. %conv28919 = zext i16 %17 to i32
  129. %and290 = shl nuw nsw i32 %conv28919, 1
  130. %arrayidx292 = getelementptr inbounds [4 x i16], [4 x i16]* %bc, i64 0, i64 2
  131. %18 = load i16, i16* %arrayidx292, align 2
  132. %conv29327 = zext i16 %18 to i32
  133. %shr29420 = lshr i32 %conv29327, 1
  134. %and295 = and i32 %shr29420, 1
  135. %or296 = or i32 %and290, %and295
  136. %conv297 = trunc i32 %or296 to i8
  137. %incdec.ptr298 = getelementptr inbounds i8, i8* %c, i64 20
  138. store i8 %conv297, i8* %incdec.ptr287, align 1
  139. %conv30021 = trunc i16 %18 to i8
  140. %and301 = shl i8 %conv30021, 7
  141. %incdec.ptr314 = getelementptr inbounds i8, i8* %c, i64 21
  142. store i8 %and301, i8* %incdec.ptr298, align 1
  143. %incdec.ptr335 = getelementptr inbounds i8, i8* %c, i64 22
  144. store i8 0, i8* %incdec.ptr314, align 1
  145. %arrayidx340 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 29
  146. %19 = load i16, i16* %arrayidx340, align 2
  147. %conv34122 = trunc i16 %19 to i8
  148. %and342 = shl i8 %conv34122, 3
  149. %shl343 = and i8 %and342, 56
  150. %incdec.ptr350 = getelementptr inbounds i8, i8* %c, i64 23
  151. store i8 %shl343, i8* %incdec.ptr335, align 1
  152. %arrayidx355 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 32
  153. %20 = bitcast i16* %arrayidx355 to i32*
  154. %21 = load i32, i32* %20, align 16
  155. %conv35623 = shl i32 %21, 2
  156. %shl358 = and i32 %conv35623, 28
  157. %22 = lshr i32 %21, 17
  158. %and363 = and i32 %22, 3
  159. %or364 = or i32 %shl358, %and363
  160. %conv365 = trunc i32 %or364 to i8
  161. store i8 %conv365, i8* %incdec.ptr350, align 1
  162. unreachable
  163. ; CHECK-LABEL: @gsm_encode(
  164. }
  165. declare void @Gsm_Coder(%struct.gsm_state.2.8.39.44.45.55.56.57.58.59.62.63.64.65.74.75.76.77.80.87.92.93.94.95.96.97.110.111.112.113.114.128.130.135.136.137.138.139.140.141.142.143.144.145.148.149.150.151.152.169.170.177.178.179.184.185.186.187.188.201.208.209.219.220.221.223.224.225.230.231.232.233.235.236.237.238.245.246.248.249.272.274.279.280.281.282.283.286.293.298.299.314.315.316.317.318.319.320.321.322.323.324.325.326.327.328.329.330.331.332.333.334.335.336.337.338.339.340.341.342.343.344.345.346.347.348.349.350.351.352.353.565*, i16*, i16*, i16*, i16*, i16*, i16*, i16*)
  166. declare void @llvm.trap() noreturn nounwind