aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/Transforms/VectorCombine/RISCV/binop-scalarize.ll
blob: ec4f6cc7520d12403bff3d04f4886fbf4e3ee966 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -S -p vector-combine -mtriple=riscv64 -mattr=+v | FileCheck %s

define <4 x i32> @add_constant_load(ptr %p) {
; CHECK-LABEL: define <4 x i32> @add_constant_load(
; CHECK-SAME: ptr [[P:%.*]]) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT:    [[X:%.*]] = load i32, ptr [[P]], align 4
; CHECK-NEXT:    [[V_SCALAR:%.*]] = add i32 [[X]], 42
; CHECK-NEXT:    [[V:%.*]] = insertelement <4 x i32> poison, i32 [[V_SCALAR]], i64 0
; CHECK-NEXT:    ret <4 x i32> [[V]]
;
  %x = load i32, ptr %p
  %ins = insertelement <4 x i32> poison, i32 %x, i32 0
  %v = add <4 x i32> %ins, splat (i32 42)
  ret <4 x i32> %v
}