| ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6 | |
| ; RUN: opt -S -mtriple=x86_64-unknown-linux-gnu -passes=slp-vectorizer < %s | FileCheck %s | |
| define { i64, i64 } @test(ptr %arg1) { | |
| ; CHECK-LABEL: define { i64, i64 } @test( | |
| ; CHECK-SAME: ptr [[ARG1:%.*]]) { | |
| ; CHECK-NEXT: [[BB:.*:]] | |
| ; CHECK-NEXT: [[VEC2STRUCT_SLOT:%.*]] = alloca { i64, i64 }, align 16 | |
| ; CHECK-NEXT: [[TMP0:%.*]] = load <2 x i32>, ptr [[ARG1]], align 4 | |
| ; CHECK-NEXT: [[TMP1:%.*]] = sitofp <2 x i32> [[TMP0]] to <2 x float> | |
| ; CHECK-NEXT: [[TMP2:%.*]] = fpext <2 x float> [[TMP1]] to <2 x double> | |
| ; CHECK-NEXT: [[TMP3:%.*]] = bitcast <2 x double> [[TMP2]] to <2 x i64> | |
| ; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <2 x i64> [[TMP3]], <2 x i64> poison, <2 x i32> <i32 1, i32 0> | |
| ; CHECK-NEXT: store <2 x i64> [[TMP5]], ptr [[VEC2STRUCT_SLOT]], align 16 | |
| ; CHECK-NEXT: [[VEC2STRUCT:%.*]] = load { i64, i64 }, ptr [[VEC2STRUCT_SLOT]], align 16 | |
| ; CHECK-NEXT: ret { i64, i64 } [[VEC2STRUCT]] | |
| ; | |
| bb: | |
| %getelementptr = getelementptr i8, ptr %arg1, i64 4 | |
| %load = load i32, ptr %arg1, align 4 | |
| %sitofp = sitofp i32 %load to float | |
| %load4 = load i32, ptr %getelementptr, align 4 | |
| %sitofp5 = sitofp i32 %load4 to float | |
| %fpext = fpext float %sitofp5 to double | |
| %bitcast.i = bitcast double %fpext to i64 | |
| %insertvalue = insertvalue { i64, i64 } poison, i64 %bitcast.i, 0 | |
| %fpext9 = fpext float %sitofp to double | |
| %bitcast.i12 = bitcast double %fpext9 to i64 | |
| %insertvalue14 = insertvalue { i64, i64 } %insertvalue, i64 %bitcast.i12, 1 | |
| ret { i64, i64 } %insertvalue14 | |
| } | |
| define { i64, i64 } @testi1(ptr %arg1) { | |
| ; CHECK-LABEL: define { i64, i64 } @testi1( | |
| ; CHECK-SAME: ptr [[ARG1:%.*]]) { | |
| ; CHECK-NEXT: [[BB:.*:]] | |
| ; CHECK-NEXT: [[VEC2STRUCT_SLOT:%.*]] = alloca { i64, i64 }, align 16 | |
| ; CHECK-NEXT: [[TMP0:%.*]] = load <2 x i32>, ptr [[ARG1]], align 4 | |
| ; CHECK-NEXT: [[TMP1:%.*]] = sitofp <2 x i32> [[TMP0]] to <2 x float> | |
| ; CHECK-NEXT: [[TMP2:%.*]] = fpext <2 x float> [[TMP1]] to <2 x double> | |
| ; CHECK-NEXT: [[TMP3:%.*]] = bitcast <2 x double> [[TMP2]] to <2 x i64> | |
| ; CHECK-NEXT: [[TMP4:%.*]] = and <2 x i64> [[TMP3]], <i64 -1, i64 1> | |
| ; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <2 x i64> [[TMP4]], <2 x i64> poison, <2 x i32> <i32 1, i32 0> | |
| ; CHECK-NEXT: store <2 x i64> [[TMP5]], ptr [[VEC2STRUCT_SLOT]], align 16 | |
| ; CHECK-NEXT: [[VEC2STRUCT:%.*]] = load { i64, i64 }, ptr [[VEC2STRUCT_SLOT]], align 16 | |
| ; CHECK-NEXT: ret { i64, i64 } [[VEC2STRUCT]] | |
| ; | |
| bb: | |
| %gep = getelementptr i8, ptr %arg1, i64 4 | |
| %load = load i32, ptr %arg1, align 4 | |
| %sitofp = sitofp i32 %load to float | |
| %load4 = load i32, ptr %gep, align 4 | |
| %sitofp5 = sitofp i32 %load4 to float | |
| %fpext = fpext float %sitofp5 to double | |
| %bc = bitcast double %fpext to i64 | |
| %fpext9 = fpext float %sitofp to double | |
| %bc9 = bitcast double %fpext9 to i64 | |
| %and = and i64 %bc, 1 | |
| %iv0 = insertvalue { i64, i64 } poison, i64 %and, 0 | |
| %iv1 = insertvalue { i64, i64 } %iv0, i64 %bc9, 1 | |
| ret { i64, i64 } %iv1 | |
| } |