|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 |
| 2 | +; RUN: opt < %s -passes=instcombine -S | FileCheck %s |
| 3 | + |
| 4 | +define <16 x i8> @wombat(<16 x i8> %arg) { |
| 5 | +; CHECK-LABEL: define <16 x i8> @wombat( |
| 6 | +; CHECK-SAME: <16 x i8> [[ARG:%.*]]) { |
| 7 | +; CHECK-NEXT: [[BITCAST:%.*]] = bitcast <16 x i8> [[ARG]] to <8 x i16> |
| 8 | +; CHECK-NEXT: [[LSHR:%.*]] = lshr <8 x i16> [[BITCAST]], splat (i16 4) |
| 9 | +; CHECK-NEXT: [[BITCAST1:%.*]] = bitcast <8 x i16> [[LSHR]] to <16 x i8> |
| 10 | +; CHECK-NEXT: [[AND:%.*]] = and <16 x i8> [[BITCAST1]], splat (i8 3) |
| 11 | +; CHECK-NEXT: [[SHL:%.*]] = shl <8 x i16> [[BITCAST]], splat (i16 4) |
| 12 | +; CHECK-NEXT: [[BITCAST2:%.*]] = bitcast <8 x i16> [[SHL]] to <16 x i8> |
| 13 | +; CHECK-NEXT: [[AND3:%.*]] = and <16 x i8> [[BITCAST2]], splat (i8 48) |
| 14 | +; CHECK-NEXT: [[OR:%.*]] = or disjoint <16 x i8> [[AND]], [[AND3]] |
| 15 | +; CHECK-NEXT: [[BITCAST4:%.*]] = bitcast <16 x i8> [[OR]] to <8 x i16> |
| 16 | +; CHECK-NEXT: [[SHL5:%.*]] = shl nuw <8 x i16> [[BITCAST4]], splat (i16 2) |
| 17 | +; CHECK-NEXT: [[BITCAST6:%.*]] = bitcast <8 x i16> [[SHL5]] to <16 x i8> |
| 18 | +; CHECK-NEXT: ret <16 x i8> [[BITCAST6]] |
| 19 | +; |
| 20 | + %bitcast = bitcast <16 x i8> %arg to <8 x i16> |
| 21 | + %lshr = lshr <8 x i16> %bitcast, splat (i16 4) |
| 22 | + %bitcast1 = bitcast <8 x i16> %lshr to <16 x i8> |
| 23 | + %and = and <16 x i8> %bitcast1, splat (i8 3) |
| 24 | + %shl = shl <8 x i16> %bitcast, splat (i16 4) |
| 25 | + %bitcast2 = bitcast <8 x i16> %shl to <16 x i8> |
| 26 | + %and3 = and <16 x i8> %bitcast2, splat (i8 48) |
| 27 | + %or = or disjoint <16 x i8> %and, %and3 |
| 28 | + %bitcast4 = bitcast <16 x i8> %or to <8 x i16> |
| 29 | + %shl5 = shl nuw <8 x i16> %bitcast4, splat (i16 2) |
| 30 | + %bitcast6 = bitcast <8 x i16> %shl5 to <16 x i8> |
| 31 | + %and7 = and <16 x i8> %bitcast6, splat (i8 -4) |
| 32 | + ret <16 x i8> %and7 |
| 33 | +} |
| 34 | + |
| 35 | +define <16 x i8> @snork(<8 x i16> %arg) { |
| 36 | +; CHECK-LABEL: define <16 x i8> @snork( |
| 37 | +; CHECK-SAME: <8 x i16> [[ARG:%.*]]) { |
| 38 | +; CHECK-NEXT: [[BITCAST:%.*]] = bitcast <8 x i16> [[ARG]] to <16 x i8> |
| 39 | +; CHECK-NEXT: [[SHUFFLEVECTOR:%.*]] = shufflevector <16 x i8> [[BITCAST]], <16 x i8> poison, <16 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6, i32 9, i32 8, i32 11, i32 10, i32 13, i32 12, i32 15, i32 14> |
| 40 | +; CHECK-NEXT: [[BITCAST1:%.*]] = bitcast <16 x i8> [[SHUFFLEVECTOR]] to <8 x i16> |
| 41 | +; CHECK-NEXT: [[LSHR:%.*]] = lshr <8 x i16> [[BITCAST1]], splat (i16 4) |
| 42 | +; CHECK-NEXT: [[BITCAST2:%.*]] = bitcast <8 x i16> [[LSHR]] to <16 x i8> |
| 43 | +; CHECK-NEXT: [[AND:%.*]] = and <16 x i8> [[BITCAST2]], splat (i8 3) |
| 44 | +; CHECK-NEXT: [[SHL:%.*]] = shl <8 x i16> [[BITCAST1]], splat (i16 4) |
| 45 | +; CHECK-NEXT: [[BITCAST3:%.*]] = bitcast <8 x i16> [[SHL]] to <16 x i8> |
| 46 | +; CHECK-NEXT: [[AND4:%.*]] = and <16 x i8> [[BITCAST3]], splat (i8 48) |
| 47 | +; CHECK-NEXT: [[OR:%.*]] = or disjoint <16 x i8> [[AND]], [[AND4]] |
| 48 | +; CHECK-NEXT: [[BITCAST5:%.*]] = bitcast <16 x i8> [[OR]] to <8 x i16> |
| 49 | +; CHECK-NEXT: [[SHL6:%.*]] = shl nuw <8 x i16> [[BITCAST5]], splat (i16 2) |
| 50 | +; CHECK-NEXT: [[BITCAST7:%.*]] = bitcast <8 x i16> [[SHL6]] to <16 x i8> |
| 51 | +; CHECK-NEXT: ret <16 x i8> [[BITCAST7]] |
| 52 | +; |
| 53 | + %bitcast = bitcast <8 x i16> %arg to <16 x i8> |
| 54 | + %shufflevector = shufflevector <16 x i8> %bitcast, <16 x i8> poison, <16 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6, i32 9, i32 8, i32 11, i32 10, i32 13, i32 12, i32 15, i32 14> |
| 55 | + %bitcast1 = bitcast <16 x i8> %shufflevector to <8 x i16> |
| 56 | + %lshr = lshr <8 x i16> %bitcast1, splat (i16 4) |
| 57 | + %bitcast2 = bitcast <8 x i16> %lshr to <16 x i8> |
| 58 | + %and = and <16 x i8> %bitcast2, splat (i8 3) |
| 59 | + %shl = shl <8 x i16> %bitcast1, splat (i16 4) |
| 60 | + %bitcast3 = bitcast <8 x i16> %shl to <16 x i8> |
| 61 | + %and4 = and <16 x i8> %bitcast3, splat (i8 48) |
| 62 | + %or = or disjoint <16 x i8> %and, %and4 |
| 63 | + %bitcast5 = bitcast <16 x i8> %or to <8 x i16> |
| 64 | + %shl6 = shl nuw <8 x i16> %bitcast5, splat (i16 2) |
| 65 | + %bitcast7 = bitcast <8 x i16> %shl6 to <16 x i8> |
| 66 | + %and8 = and <16 x i8> %bitcast7, splat (i8 -4) |
| 67 | + ret <16 x i8> %and8 |
| 68 | +} |
| 69 | + |
| 70 | +define <16 x i8> @wobble(<8 x i16> %arg) { |
| 71 | +; CHECK-LABEL: define <16 x i8> @wobble( |
| 72 | +; CHECK-SAME: <8 x i16> [[ARG:%.*]]) { |
| 73 | +; CHECK-NEXT: [[BITCAST:%.*]] = bitcast <8 x i16> [[ARG]] to <16 x i8> |
| 74 | +; CHECK-NEXT: [[AND:%.*]] = and <16 x i8> [[BITCAST]], splat (i8 15) |
| 75 | +; CHECK-NEXT: [[SHUFFLEVECTOR:%.*]] = shufflevector <16 x i8> [[AND]], <16 x i8> poison, <16 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6, i32 9, i32 8, i32 11, i32 10, i32 13, i32 12, i32 15, i32 14> |
| 76 | +; CHECK-NEXT: [[BITCAST1:%.*]] = bitcast <16 x i8> [[SHUFFLEVECTOR]] to <8 x i16> |
| 77 | +; CHECK-NEXT: [[SHL:%.*]] = shl nuw <8 x i16> [[BITCAST1]], splat (i16 4) |
| 78 | +; CHECK-NEXT: [[BITCAST2:%.*]] = bitcast <8 x i16> [[SHL]] to <16 x i8> |
| 79 | +; CHECK-NEXT: ret <16 x i8> [[BITCAST2]] |
| 80 | +; |
| 81 | + %bitcast = bitcast <8 x i16> %arg to <16 x i8> |
| 82 | + %and = and <16 x i8> %bitcast, splat (i8 15) |
| 83 | + %shufflevector = shufflevector <16 x i8> %and, <16 x i8> poison, <16 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6, i32 9, i32 8, i32 11, i32 10, i32 13, i32 12, i32 15, i32 14> |
| 84 | + %bitcast1 = bitcast <16 x i8> %shufflevector to <8 x i16> |
| 85 | + %shl = shl nuw <8 x i16> %bitcast1, splat (i16 4) |
| 86 | + %bitcast2 = bitcast <8 x i16> %shl to <16 x i8> |
| 87 | + %and3 = and <16 x i8> %bitcast2, splat (i8 -16) |
| 88 | + ret <16 x i8> %and3 |
| 89 | +} |
| 90 | + |
| 91 | +define <16 x i8> @wobble.1(<8 x i16> %arg) { |
| 92 | +; CHECK-LABEL: define <16 x i8> @wobble.1( |
| 93 | +; CHECK-SAME: <8 x i16> [[ARG:%.*]]) { |
| 94 | +; CHECK-NEXT: [[BITCAST:%.*]] = bitcast <8 x i16> [[ARG]] to <16 x i8> |
| 95 | +; CHECK-NEXT: [[AND:%.*]] = and <16 x i8> [[BITCAST]], splat (i8 15) |
| 96 | +; CHECK-NEXT: [[SHUFFLEVECTOR:%.*]] = shufflevector <16 x i8> [[AND]], <16 x i8> poison, <16 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4, i32 11, i32 10, i32 9, i32 8, i32 15, i32 14, i32 13, i32 12> |
| 97 | +; CHECK-NEXT: [[BITCAST1:%.*]] = bitcast <16 x i8> [[SHUFFLEVECTOR]] to <8 x i16> |
| 98 | +; CHECK-NEXT: [[SHL:%.*]] = shl nuw <8 x i16> [[BITCAST1]], splat (i16 4) |
| 99 | +; CHECK-NEXT: [[BITCAST2:%.*]] = bitcast <8 x i16> [[SHL]] to <16 x i8> |
| 100 | +; CHECK-NEXT: ret <16 x i8> [[BITCAST2]] |
| 101 | +; |
| 102 | + %bitcast = bitcast <8 x i16> %arg to <16 x i8> |
| 103 | + %and = and <16 x i8> %bitcast, splat (i8 15) |
| 104 | + %shufflevector = shufflevector <16 x i8> %and, <16 x i8> poison, <16 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4, i32 11, i32 10, i32 9, i32 8, i32 15, i32 14, i32 13, i32 12> |
| 105 | + %bitcast1 = bitcast <16 x i8> %shufflevector to <8 x i16> |
| 106 | + %shl = shl nuw <8 x i16> %bitcast1, splat (i16 4) |
| 107 | + %bitcast2 = bitcast <8 x i16> %shl to <16 x i8> |
| 108 | + %and3 = and <16 x i8> %bitcast2, splat (i8 -16) |
| 109 | + ret <16 x i8> %and3 |
| 110 | +} |
| 111 | + |
| 112 | +define <16 x i8> @pluto(<16 x i8> %arg) { |
| 113 | +; CHECK-LABEL: define <16 x i8> @pluto( |
| 114 | +; CHECK-SAME: <16 x i8> [[ARG:%.*]]) { |
| 115 | +; CHECK-NEXT: [[SHUFFLEVECTOR:%.*]] = shufflevector <16 x i8> [[ARG]], <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison>, <16 x i32> <i32 0, i32 16, i32 1, i32 17, i32 2, i32 18, i32 3, i32 19, i32 4, i32 20, i32 5, i32 21, i32 6, i32 22, i32 7, i32 23> |
| 116 | +; CHECK-NEXT: [[BITCAST:%.*]] = bitcast <16 x i8> [[SHUFFLEVECTOR]] to <8 x i16> |
| 117 | +; CHECK-NEXT: [[MUL:%.*]] = mul nuw <8 x i16> [[BITCAST]], <i16 171, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0> |
| 118 | +; CHECK-NEXT: [[LSHR:%.*]] = lshr <8 x i16> [[MUL]], splat (i16 15) |
| 119 | +; CHECK-NEXT: [[BITCAST1:%.*]] = bitcast <8 x i16> [[LSHR]] to <16 x i8> |
| 120 | +; CHECK-NEXT: ret <16 x i8> [[BITCAST1]] |
| 121 | +; |
| 122 | + %shufflevector = shufflevector <16 x i8> %arg, <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison>, <16 x i32> <i32 0, i32 16, i32 1, i32 17, i32 2, i32 18, i32 3, i32 19, i32 4, i32 20, i32 5, i32 21, i32 6, i32 22, i32 7, i32 23> |
| 123 | + %bitcast = bitcast <16 x i8> %shufflevector to <8 x i16> |
| 124 | + %mul = mul nuw <8 x i16> %bitcast, <i16 171, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0> |
| 125 | + %lshr = lshr <8 x i16> %mul, splat (i16 15) |
| 126 | + %bitcast1 = bitcast <8 x i16> %lshr to <16 x i8> |
| 127 | + %and = and <16 x i8> %bitcast1, splat (i8 1) |
| 128 | + ret <16 x i8> %and |
| 129 | +} |
| 130 | + |
| 131 | +define <16 x i8> @wibble(<8 x i16> %arg) { |
| 132 | +; CHECK-LABEL: define <16 x i8> @wibble( |
| 133 | +; CHECK-SAME: <8 x i16> [[ARG:%.*]]) { |
| 134 | +; CHECK-NEXT: [[BITCAST:%.*]] = bitcast <8 x i16> [[ARG]] to <16 x i8> |
| 135 | +; CHECK-NEXT: [[SHUFFLEVECTOR:%.*]] = shufflevector <16 x i8> [[BITCAST]], <16 x i8> poison, <16 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4, i32 11, i32 10, i32 9, i32 8, i32 15, i32 14, i32 13, i32 12> |
| 136 | +; CHECK-NEXT: [[BITCAST1:%.*]] = bitcast <16 x i8> [[SHUFFLEVECTOR]] to <8 x i16> |
| 137 | +; CHECK-NEXT: [[LSHR:%.*]] = lshr <8 x i16> [[BITCAST1]], splat (i16 4) |
| 138 | +; CHECK-NEXT: [[BITCAST2:%.*]] = bitcast <8 x i16> [[LSHR]] to <16 x i8> |
| 139 | +; CHECK-NEXT: [[AND:%.*]] = and <16 x i8> [[BITCAST2]], splat (i8 3) |
| 140 | +; CHECK-NEXT: [[SHL:%.*]] = shl <8 x i16> [[BITCAST1]], splat (i16 4) |
| 141 | +; CHECK-NEXT: [[BITCAST3:%.*]] = bitcast <8 x i16> [[SHL]] to <16 x i8> |
| 142 | +; CHECK-NEXT: [[AND4:%.*]] = and <16 x i8> [[BITCAST3]], splat (i8 48) |
| 143 | +; CHECK-NEXT: [[OR:%.*]] = or disjoint <16 x i8> [[AND]], [[AND4]] |
| 144 | +; CHECK-NEXT: [[BITCAST5:%.*]] = bitcast <16 x i8> [[OR]] to <8 x i16> |
| 145 | +; CHECK-NEXT: [[SHL6:%.*]] = shl nuw <8 x i16> [[BITCAST5]], splat (i16 2) |
| 146 | +; CHECK-NEXT: [[BITCAST7:%.*]] = bitcast <8 x i16> [[SHL6]] to <16 x i8> |
| 147 | +; CHECK-NEXT: ret <16 x i8> [[BITCAST7]] |
| 148 | +; |
| 149 | + %bitcast = bitcast <8 x i16> %arg to <16 x i8> |
| 150 | + %shufflevector = shufflevector <16 x i8> %bitcast, <16 x i8> poison, <16 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4, i32 11, i32 10, i32 9, i32 8, i32 15, i32 14, i32 13, i32 12> |
| 151 | + %bitcast1 = bitcast <16 x i8> %shufflevector to <8 x i16> |
| 152 | + %lshr = lshr <8 x i16> %bitcast1, splat (i16 4) |
| 153 | + %bitcast2 = bitcast <8 x i16> %lshr to <16 x i8> |
| 154 | + %and = and <16 x i8> %bitcast2, splat (i8 3) |
| 155 | + %shl = shl <8 x i16> %bitcast1, splat (i16 4) |
| 156 | + %bitcast3 = bitcast <8 x i16> %shl to <16 x i8> |
| 157 | + %and4 = and <16 x i8> %bitcast3, splat (i8 48) |
| 158 | + %or = or disjoint <16 x i8> %and, %and4 |
| 159 | + %bitcast5 = bitcast <16 x i8> %or to <8 x i16> |
| 160 | + %shl6 = shl nuw <8 x i16> %bitcast5, splat (i16 2) |
| 161 | + %bitcast7 = bitcast <8 x i16> %shl6 to <16 x i8> |
| 162 | + %and8 = and <16 x i8> %bitcast7, splat (i8 -4) |
| 163 | + ret <16 x i8> %and8 |
| 164 | +} |
| 165 | + |
| 166 | +define <16 x i8> @hoge(<4 x i32> %arg) { |
| 167 | +; CHECK-LABEL: define <16 x i8> @hoge( |
| 168 | +; CHECK-SAME: <4 x i32> [[ARG:%.*]]) { |
| 169 | +; CHECK-NEXT: [[BITCAST:%.*]] = bitcast <4 x i32> [[ARG]] to <16 x i8> |
| 170 | +; CHECK-NEXT: [[SHUFFLEVECTOR:%.*]] = shufflevector <16 x i8> [[BITCAST]], <16 x i8> poison, <16 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4, i32 11, i32 10, i32 9, i32 8, i32 15, i32 14, i32 13, i32 12> |
| 171 | +; CHECK-NEXT: [[BITCAST1:%.*]] = bitcast <16 x i8> [[SHUFFLEVECTOR]] to <8 x i16> |
| 172 | +; CHECK-NEXT: [[SHL:%.*]] = shl <8 x i16> [[BITCAST1]], splat (i16 4) |
| 173 | +; CHECK-NEXT: [[BITCAST2:%.*]] = bitcast <8 x i16> [[SHL]] to <16 x i8> |
| 174 | +; CHECK-NEXT: [[AND:%.*]] = and <16 x i8> [[BITCAST2]], splat (i8 48) |
| 175 | +; CHECK-NEXT: [[LSHR:%.*]] = lshr <8 x i16> [[BITCAST1]], splat (i16 4) |
| 176 | +; CHECK-NEXT: [[BITCAST3:%.*]] = bitcast <8 x i16> [[LSHR]] to <16 x i8> |
| 177 | +; CHECK-NEXT: [[AND4:%.*]] = and <16 x i8> [[BITCAST3]], splat (i8 3) |
| 178 | +; CHECK-NEXT: [[OR:%.*]] = or disjoint <16 x i8> [[AND4]], [[AND]] |
| 179 | +; CHECK-NEXT: [[BITCAST5:%.*]] = bitcast <16 x i8> [[OR]] to <8 x i16> |
| 180 | +; CHECK-NEXT: [[SHL6:%.*]] = shl nuw <8 x i16> [[BITCAST5]], splat (i16 2) |
| 181 | +; CHECK-NEXT: [[BITCAST7:%.*]] = bitcast <8 x i16> [[SHL6]] to <16 x i8> |
| 182 | +; CHECK-NEXT: ret <16 x i8> [[BITCAST7]] |
| 183 | +; |
| 184 | + %bitcast = bitcast <4 x i32> %arg to <16 x i8> |
| 185 | + %shufflevector = shufflevector <16 x i8> %bitcast, <16 x i8> poison, <16 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4, i32 11, i32 10, i32 9, i32 8, i32 15, i32 14, i32 13, i32 12> |
| 186 | + %bitcast1 = bitcast <16 x i8> %shufflevector to <8 x i16> |
| 187 | + %shl = shl <8 x i16> %bitcast1, splat (i16 4) |
| 188 | + %bitcast2 = bitcast <8 x i16> %shl to <16 x i8> |
| 189 | + %and = and <16 x i8> %bitcast2, splat (i8 48) |
| 190 | + %lshr = lshr <8 x i16> %bitcast1, splat (i16 4) |
| 191 | + %bitcast3 = bitcast <8 x i16> %lshr to <16 x i8> |
| 192 | + %and4 = and <16 x i8> %bitcast3, splat (i8 3) |
| 193 | + %or = or disjoint <16 x i8> %and4, %and |
| 194 | + %bitcast5 = bitcast <16 x i8> %or to <8 x i16> |
| 195 | + %shl6 = shl nuw <8 x i16> %bitcast5, splat (i16 2) |
| 196 | + %bitcast7 = bitcast <8 x i16> %shl6 to <16 x i8> |
| 197 | + %and8 = and <16 x i8> %bitcast7, splat (i8 -4) |
| 198 | + ret <16 x i8> %and8 |
| 199 | +} |
| 200 | + |
| 201 | +define { i32, i1 } @wombat.2(i32 %arg, i32 %arg1, i32 %arg2, i32 %arg3) { |
| 202 | +; CHECK-LABEL: define { i32, i1 } @wombat.2( |
| 203 | +; CHECK-SAME: i32 [[ARG:%.*]], i32 [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) { |
| 204 | +; CHECK-NEXT: [[INSERTELEMENT:%.*]] = insertelement <4 x i32> poison, i32 [[ARG2]], i64 0 |
| 205 | +; CHECK-NEXT: [[INSERTELEMENT4:%.*]] = insertelement <4 x i32> [[INSERTELEMENT]], i32 [[ARG3]], i64 1 |
| 206 | +; CHECK-NEXT: [[BITCAST:%.*]] = bitcast <4 x i32> [[INSERTELEMENT4]] to <2 x i64> |
| 207 | +; CHECK-NEXT: [[CALL:%.*]] = tail call range(i64 0, 65) <2 x i64> @llvm.ctpop.v2i64(<2 x i64> [[BITCAST]]) |
| 208 | +; CHECK-NEXT: [[BITCAST5:%.*]] = bitcast <2 x i64> [[CALL]] to <4 x i32> |
| 209 | +; CHECK-NEXT: [[EXTRACTELEMENT:%.*]] = extractelement <4 x i32> [[BITCAST5]], i64 0 |
| 210 | +; CHECK-NEXT: [[INSERTELEMENT6:%.*]] = insertelement <4 x i32> poison, i32 [[ARG]], i64 0 |
| 211 | +; CHECK-NEXT: [[INSERTELEMENT7:%.*]] = insertelement <4 x i32> [[INSERTELEMENT6]], i32 [[ARG1]], i64 1 |
| 212 | +; CHECK-NEXT: [[BITCAST8:%.*]] = bitcast <4 x i32> [[INSERTELEMENT7]] to <2 x i64> |
| 213 | +; CHECK-NEXT: [[CALL9:%.*]] = tail call range(i64 0, 65) <2 x i64> @llvm.ctpop.v2i64(<2 x i64> [[BITCAST8]]) |
| 214 | +; CHECK-NEXT: [[BITCAST10:%.*]] = bitcast <2 x i64> [[CALL9]] to <4 x i32> |
| 215 | +; CHECK-NEXT: [[EXTRACTELEMENT11:%.*]] = extractelement <4 x i32> [[BITCAST10]], i64 0 |
| 216 | +; CHECK-NEXT: [[CALL12:%.*]] = add nuw nsw i32 [[EXTRACTELEMENT]], [[EXTRACTELEMENT11]] |
| 217 | +; CHECK-NEXT: [[TMP1:%.*]] = insertvalue { i32, i1 } { i32 poison, i1 false }, i32 [[CALL12]], 0 |
| 218 | +; CHECK-NEXT: ret { i32, i1 } [[TMP1]] |
| 219 | +; |
| 220 | + %insertelement = insertelement <4 x i32> poison, i32 %arg2, i64 0 |
| 221 | + %insertelement4 = insertelement <4 x i32> %insertelement, i32 %arg3, i64 1 |
| 222 | + %bitcast = bitcast <4 x i32> %insertelement4 to <2 x i64> |
| 223 | + %call = tail call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %bitcast) |
| 224 | + %bitcast5 = bitcast <2 x i64> %call to <4 x i32> |
| 225 | + %extractelement = extractelement <4 x i32> %bitcast5, i64 0 |
| 226 | + %insertelement6 = insertelement <4 x i32> poison, i32 %arg, i64 0 |
| 227 | + %insertelement7 = insertelement <4 x i32> %insertelement6, i32 %arg1, i64 1 |
| 228 | + %bitcast8 = bitcast <4 x i32> %insertelement7 to <2 x i64> |
| 229 | + %call9 = tail call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %bitcast8) |
| 230 | + %bitcast10 = bitcast <2 x i64> %call9 to <4 x i32> |
| 231 | + %extractelement11 = extractelement <4 x i32> %bitcast10, i64 0 |
| 232 | + %call12 = tail call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 %extractelement, i32 %extractelement11) |
| 233 | + ret { i32, i1 } %call12 |
| 234 | +} |
| 235 | + |
| 236 | +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) |
| 237 | +declare <2 x i64> @llvm.ctpop.v2i64(<2 x i64>) #0 |
| 238 | + |
| 239 | +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) |
| 240 | +declare { i32, i1 } @llvm.uadd.with.overflow.i32(i32, i32) #0 |
| 241 | + |
| 242 | +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } |
0 commit comments