| ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6 |
| ; RUN: opt -S -mtriple=amdgcn-- -mcpu=gfx1250 -passes=vector-combine < %s | FileCheck -check-prefix=OPT %s |
| |
| define <32 x i8> @extract_insert_chain(<8 x i8> %in0, <8 x i8> %in1, <8 x i8> %in2, <8 x i8> %in3) { |
| ; OPT-LABEL: define <32 x i8> @extract_insert_chain( |
| ; OPT-SAME: <8 x i8> [[IN0:%.*]], <8 x i8> [[IN1:%.*]], <8 x i8> [[IN2:%.*]], <8 x i8> [[IN3:%.*]]) #[[ATTR0:[0-9]+]] { |
| ; OPT-NEXT: [[ENTRY:.*:]] |
| ; OPT-NEXT: [[O_1_7:%.*]] = shufflevector <8 x i8> [[IN0]], <8 x i8> [[IN1]], <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> |
| ; OPT-NEXT: [[TMP2:%.*]] = shufflevector <8 x i8> [[IN2]], <8 x i8> poison, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> |
| ; OPT-NEXT: [[O_2_7:%.*]] = shufflevector <32 x i8> [[O_1_7]], <32 x i8> [[TMP2]], <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 32, i32 33, i32 34, i32 35, i32 36, i32 37, i32 38, i32 39, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31> |
| ; OPT-NEXT: [[TMP3:%.*]] = shufflevector <8 x i8> [[IN3]], <8 x i8> poison, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> |
| ; OPT-NEXT: [[O_3_7:%.*]] = shufflevector <32 x i8> [[O_2_7]], <32 x i8> [[TMP3]], <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 32, i32 33, i32 34, i32 35, i32 36, i32 37, i32 38, i32 39> |
| ; OPT-NEXT: ret <32 x i8> [[O_3_7]] |
| ; |
| entry: |
| %i.0.0 = extractelement <8 x i8> %in0, i64 0 |
| %i.0.1 = extractelement <8 x i8> %in0, i64 1 |
| %i.0.2 = extractelement <8 x i8> %in0, i64 2 |
| %i.0.3 = extractelement <8 x i8> %in0, i64 3 |
| %i.0.4 = extractelement <8 x i8> %in0, i64 4 |
| %i.0.5 = extractelement <8 x i8> %in0, i64 5 |
| %i.0.6 = extractelement <8 x i8> %in0, i64 6 |
| %i.0.7 = extractelement <8 x i8> %in0, i64 7 |
| %i.1.0 = extractelement <8 x i8> %in1, i64 0 |
| %i.1.1 = extractelement <8 x i8> %in1, i64 1 |
| %i.1.2 = extractelement <8 x i8> %in1, i64 2 |
| %i.1.3 = extractelement <8 x i8> %in1, i64 3 |
| %i.1.4 = extractelement <8 x i8> %in1, i64 4 |
| %i.1.5 = extractelement <8 x i8> %in1, i64 5 |
| %i.1.6 = extractelement <8 x i8> %in1, i64 6 |
| %i.1.7 = extractelement <8 x i8> %in1, i64 7 |
| %i.2.0 = extractelement <8 x i8> %in2, i64 0 |
| %i.2.1 = extractelement <8 x i8> %in2, i64 1 |
| %i.2.2 = extractelement <8 x i8> %in2, i64 2 |
| %i.2.3 = extractelement <8 x i8> %in2, i64 3 |
| %i.2.4 = extractelement <8 x i8> %in2, i64 4 |
| %i.2.5 = extractelement <8 x i8> %in2, i64 5 |
| %i.2.6 = extractelement <8 x i8> %in2, i64 6 |
| %i.2.7 = extractelement <8 x i8> %in2, i64 7 |
| %i.3.0 = extractelement <8 x i8> %in3, i64 0 |
| %i.3.1 = extractelement <8 x i8> %in3, i64 1 |
| %i.3.2 = extractelement <8 x i8> %in3, i64 2 |
| %i.3.3 = extractelement <8 x i8> %in3, i64 3 |
| %i.3.4 = extractelement <8 x i8> %in3, i64 4 |
| %i.3.5 = extractelement <8 x i8> %in3, i64 5 |
| %i.3.6 = extractelement <8 x i8> %in3, i64 6 |
| %i.3.7 = extractelement <8 x i8> %in3, i64 7 |
| |
| %o.0.0 = insertelement <32 x i8> poison, i8 %i.0.0, i32 0 |
| %o.0.1 = insertelement <32 x i8> %o.0.0, i8 %i.0.1, i32 1 |
| %o.0.2 = insertelement <32 x i8> %o.0.1, i8 %i.0.2, i32 2 |
| %o.0.3 = insertelement <32 x i8> %o.0.2, i8 %i.0.3, i32 3 |
| %o.0.4 = insertelement <32 x i8> %o.0.3, i8 %i.0.4, i32 4 |
| %o.0.5 = insertelement <32 x i8> %o.0.4, i8 %i.0.5, i32 5 |
| %o.0.6 = insertelement <32 x i8> %o.0.5, i8 %i.0.6, i32 6 |
| %o.0.7 = insertelement <32 x i8> %o.0.6, i8 %i.0.7, i32 7 |
| |
| %o.1.0 = insertelement <32 x i8> %o.0.7, i8 %i.1.0, i32 8 |
| %o.1.1 = insertelement <32 x i8> %o.1.0, i8 %i.1.1, i32 9 |
| %o.1.2 = insertelement <32 x i8> %o.1.1, i8 %i.1.2, i32 10 |
| %o.1.3 = insertelement <32 x i8> %o.1.2, i8 %i.1.3, i32 11 |
| %o.1.4 = insertelement <32 x i8> %o.1.3, i8 %i.1.4, i32 12 |
| %o.1.5 = insertelement <32 x i8> %o.1.4, i8 %i.1.5, i32 13 |
| %o.1.6 = insertelement <32 x i8> %o.1.5, i8 %i.1.6, i32 14 |
| %o.1.7 = insertelement <32 x i8> %o.1.6, i8 %i.1.7, i32 15 |
| |
| %o.2.0 = insertelement <32 x i8> %o.1.7, i8 %i.2.0, i32 16 |
| %o.2.1 = insertelement <32 x i8> %o.2.0, i8 %i.2.1, i32 17 |
| %o.2.2 = insertelement <32 x i8> %o.2.1, i8 %i.2.2, i32 18 |
| %o.2.3 = insertelement <32 x i8> %o.2.2, i8 %i.2.3, i32 19 |
| %o.2.4 = insertelement <32 x i8> %o.2.3, i8 %i.2.4, i32 20 |
| %o.2.5 = insertelement <32 x i8> %o.2.4, i8 %i.2.5, i32 21 |
| %o.2.6 = insertelement <32 x i8> %o.2.5, i8 %i.2.6, i32 22 |
| %o.2.7 = insertelement <32 x i8> %o.2.6, i8 %i.2.7, i32 23 |
| |
| %o.3.0 = insertelement <32 x i8> %o.2.7, i8 %i.3.0, i32 24 |
| %o.3.1 = insertelement <32 x i8> %o.3.0, i8 %i.3.1, i32 25 |
| %o.3.2 = insertelement <32 x i8> %o.3.1, i8 %i.3.2, i32 26 |
| %o.3.3 = insertelement <32 x i8> %o.3.2, i8 %i.3.3, i32 27 |
| %o.3.4 = insertelement <32 x i8> %o.3.3, i8 %i.3.4, i32 28 |
| %o.3.5 = insertelement <32 x i8> %o.3.4, i8 %i.3.5, i32 29 |
| %o.3.6 = insertelement <32 x i8> %o.3.5, i8 %i.3.6, i32 30 |
| %o.3.7 = insertelement <32 x i8> %o.3.6, i8 %i.3.7, i32 31 |
| |
| ret <32 x i8> %o.3.7 |
| } |
| |
| define <8 x i8> @extract_insert_chain_shortening(<32 x i8> %in) { |
| ; OPT-LABEL: define <8 x i8> @extract_insert_chain_shortening( |
| ; OPT-SAME: <32 x i8> [[IN:%.*]]) #[[ATTR0]] { |
| ; OPT-NEXT: [[TMP1:%.*]] = shufflevector <32 x i8> [[IN]], <32 x i8> poison, <8 x i32> <i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23> |
| ; OPT-NEXT: ret <8 x i8> [[TMP1]] |
| ; |
| %i.0 = extractelement <32 x i8> %in, i64 16 |
| %i.1 = extractelement <32 x i8> %in, i64 17 |
| %i.2 = extractelement <32 x i8> %in, i64 18 |
| %i.3 = extractelement <32 x i8> %in, i64 19 |
| %i.4 = extractelement <32 x i8> %in, i64 20 |
| %i.5 = extractelement <32 x i8> %in, i64 21 |
| %i.6 = extractelement <32 x i8> %in, i64 22 |
| %i.7 = extractelement <32 x i8> %in, i64 23 |
| |
| %o.0 = insertelement <8 x i8> poison, i8 %i.0, i32 0 |
| %o.1 = insertelement <8 x i8> %o.0, i8 %i.1, i32 1 |
| %o.2 = insertelement <8 x i8> %o.1, i8 %i.2, i32 2 |
| %o.3 = insertelement <8 x i8> %o.2, i8 %i.3, i32 3 |
| %o.4 = insertelement <8 x i8> %o.3, i8 %i.4, i32 4 |
| %o.5 = insertelement <8 x i8> %o.4, i8 %i.5, i32 5 |
| %o.6 = insertelement <8 x i8> %o.5, i8 %i.6, i32 6 |
| %o.7 = insertelement <8 x i8> %o.6, i8 %i.7, i32 7 |
| |
| ret <8 x i8> %o.7 |
| } |