; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 2 ; RUN: opt < %s -mtriple=riscv64 -mattr=+v,+f,+d -disable-output -passes="print" 2>&1 | FileCheck %s define <2 x i8> @phi_v2i8_small(i1 %c) { ; CHECK-LABEL: 'phi_v2i8_small' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <2 x i8> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i8> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <2 x i8> [, %a], [, %b] ret <2 x i8> %x } define <4 x i8> @phi_v4i8_splat(i1 %c) { ; CHECK-LABEL: 'phi_v4i8_splat' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i8> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x i8> [, %a], [, %b] ret <4 x i8> %x } define <4 x i8> @phi_v4i8_small(i1 %c) { ; CHECK-LABEL: 'phi_v4i8_small' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i8> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x i8> [, %a], [, %b] ret <4 x i8> %x } define <4 x i8> @phi_v4i8_large(i1 %c) { ; CHECK-LABEL: 'phi_v4i8_large' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i8> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x i8> [, %a], [, %b] ret <4 x i8> %x } ; The cost should be conservative and assume it will need to materialize the more expensive constant define <4 x i8> @phi_v4i8_cheap_and_expensive(i1 %c) { ; CHECK-LABEL: 'phi_v4i8_cheap_and_expensive' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i8> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x i8> [, %a], [, %b] ret <4 x i8> %x } define <4 x i16> @phi_v4i16_splat(i1 %c) { ; CHECK-LABEL: 'phi_v4i16_splat' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i16> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x i16> [, %a], [, %b] ret <4 x i16> %x } define <4 x i16> @phi_v4i16_small(i1 %c) { ; CHECK-LABEL: 'phi_v4i16_small' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i16> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x i16> [, %a], [, %b] ret <4 x i16> %x } define <4 x i16> @phi_v4i16_large(i1 %c) { ; CHECK-LABEL: 'phi_v4i16_large' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i16> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x i16> [, %a], [, %b] ret <4 x i16> %x } ; The cost should be conservative and assume it will need to materialize the more expensive constant define <4 x i16> @phi_v4i16_cheap_and_expensive(i1 %c) { ; CHECK-LABEL: 'phi_v4i16_cheap_and_expensive' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i16> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x i16> [, %a], [, %b] ret <4 x i16> %x } define <4 x i32> @phi_v4i32_splat(i1 %c) { ; CHECK-LABEL: 'phi_v4i32_splat' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i32> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x i32> [, %a], [, %b] ret <4 x i32> %x } define <4 x i32> @phi_v4i32_small(i1 %c) { ; CHECK-LABEL: 'phi_v4i32_small' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i32> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x i32> [, %a], [, %b] ret <4 x i32> %x } define <4 x i32> @phi_v4i32_large(i1 %c) { ; CHECK-LABEL: 'phi_v4i32_large' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i32> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x i32> [, %a], [, %b] ret <4 x i32> %x } ; The cost should be conservative and assume it will need to materialize the more expensive constant define <4 x i32> @phi_v4i32_cheap_and_expensive(i1 %c) { ; CHECK-LABEL: 'phi_v4i32_cheap_and_expensive' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i32> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x i32> [, %a], [, %b] ret <4 x i32> %x } define <4 x i64> @phi_v4i64_splat(i1 %c) { ; CHECK-LABEL: 'phi_v4i64_splat' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i64> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x i64> [, %a], [, %b] ret <4 x i64> %x } define <4 x i64> @phi_v4i64_small(i1 %c) { ; CHECK-LABEL: 'phi_v4i64_small' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i64> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x i64> [, %a], [, %b] ret <4 x i64> %x } define <4 x i64> @phi_v4i64_large(i1 %c) { ; CHECK-LABEL: 'phi_v4i64_large' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i64> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x i64> [, %a], [, %b] ret <4 x i64> %x } ; The cost should be conservative and assume it will need to materialize the more expensive constant define <4 x i64> @phi_v4i64_cheap_and_expensive(i1 %c) { ; CHECK-LABEL: 'phi_v4i64_cheap_and_expensive' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i64> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x i64> [, %a], [, %b] ret <4 x i64> %x } define <4 x half> @phi_v4f16_splat(i1 %c) { ; CHECK-LABEL: 'phi_v4f16_splat' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x half> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x half> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x half> [, %a], [, %b] ret <4 x half> %x } define <4 x half> @phi_v4f16(i1 %c) { ; CHECK-LABEL: 'phi_v4f16' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x half> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x half> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x half> [, %a], [, %b] ret <4 x half> %x } ; The cost should be conservative and assume it will need to materialize the more expensive constant define <4 x half> @phi_v4f16_cheap_and_expensive(i1 %c) { ; CHECK-LABEL: 'phi_v4f16_cheap_and_expensive' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x half> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x half> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x half> [, %a], [, %b] ret <4 x half> %x } define <4 x float> @phi_v4f32_splat(i1 %c) { ; CHECK-LABEL: 'phi_v4f32_splat' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x float> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x float> [, %a], [, %b] ret <4 x float> %x } define <4 x float> @phi_v4f32(i1 %c) { ; CHECK-LABEL: 'phi_v4f32' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x float> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x float> [, %a], [, %b] ret <4 x float> %x } ; The cost should be conservative and assume it will need to materialize the more expensive constant define <4 x float> @phi_v4f32_cheap_and_expensive(i1 %c) { ; CHECK-LABEL: 'phi_v4f32_cheap_and_expensive' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x float> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x float> [, %a], [, %b] ret <4 x float> %x } define <4 x double> @phi_v4f64_splat(i1 %c) { ; CHECK-LABEL: 'phi_v4f64_splat' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x double> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x double> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x double> [, %a], [, %b] ret <4 x double> %x } define <4 x double> @phi_v4f64(i1 %c) { ; CHECK-LABEL: 'phi_v4f64' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x double> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x double> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x double> [, %a], [, %b] ret <4 x double> %x } ; The cost should be conservative and assume it will need to materialize the more expensive constant define <4 x double> @phi_v4f64_cheap_and_expensive(i1 %c) { ; CHECK-LABEL: 'phi_v4f64_cheap_and_expensive' ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x double> [ , %a ], [ , %b ] ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x double> %x ; br i1 %c, label %a, label %b a: br label %d b: br label %d d: %x = phi <4 x double> [, %a], [, %b] ret <4 x double> %x }