brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · ef2e224 Raw
36 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 52; RUN: opt -passes='lower-matrix-intrinsics' -S < %s | FileCheck %s3 4; We can only fold matching transposes.5 6define void @reshape(ptr %in, ptr %out) {7; CHECK-LABEL: define void @reshape(8; CHECK-SAME: ptr [[IN:%.*]], ptr [[OUT:%.*]]) {9; CHECK-NEXT:  [[ENTRY:.*:]]10; CHECK-NEXT:    [[COL_LOAD:%.*]] = load <4 x double>, ptr [[IN]], align 811; CHECK-NEXT:    [[SPLIT:%.*]] = shufflevector <4 x double> [[COL_LOAD]], <4 x double> poison, <2 x i32> <i32 0, i32 1>12; CHECK-NEXT:    [[SPLIT1:%.*]] = shufflevector <4 x double> [[COL_LOAD]], <4 x double> poison, <2 x i32> <i32 2, i32 3>13; CHECK-NEXT:    [[TMP0:%.*]] = extractelement <2 x double> [[SPLIT]], i64 014; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x double> poison, double [[TMP0]], i64 015; CHECK-NEXT:    [[TMP2:%.*]] = extractelement <2 x double> [[SPLIT1]], i64 016; CHECK-NEXT:    [[TMP3:%.*]] = insertelement <2 x double> [[TMP1]], double [[TMP2]], i64 117; CHECK-NEXT:    [[TMP4:%.*]] = extractelement <2 x double> [[SPLIT]], i64 118; CHECK-NEXT:    [[TMP5:%.*]] = insertelement <2 x double> poison, double [[TMP4]], i64 019; CHECK-NEXT:    [[TMP6:%.*]] = extractelement <2 x double> [[SPLIT1]], i64 120; CHECK-NEXT:    [[TMP7:%.*]] = insertelement <2 x double> [[TMP5]], double [[TMP6]], i64 121; CHECK-NEXT:    store <2 x double> [[TMP3]], ptr [[OUT]], align 822; CHECK-NEXT:    [[VEC_GEP:%.*]] = getelementptr double, ptr [[OUT]], i64 223; CHECK-NEXT:    store <2 x double> [[TMP7]], ptr [[VEC_GEP]], align 824; CHECK-NEXT:    ret void25;26entry:27  %0 = load <4 x double>, ptr %in, align 828  %1 = tail call <4 x double> @llvm.matrix.transpose.v4f64(<4 x double> %0, i32 4, i32 1)29  %2 = tail call <4 x double> @llvm.matrix.transpose.v4f64(<4 x double> %1, i32 1, i32 4)30  %3 = tail call <4 x double> @llvm.matrix.transpose.v4f64(<4 x double> %2, i32 2, i32 2)31  %4 = tail call <4 x double> @llvm.matrix.transpose.v4f64(<4 x double> %3, i32 2, i32 2)32  %5 = tail call <4 x double> @llvm.matrix.transpose.v4f64(<4 x double> %4, i32 2, i32 2)33  store <4 x double> %5, ptr %out, align 834  ret void35}36