| ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py |
| ; RUN: opt < %s -passes='sroa<preserve-cfg>' -S | FileCheck %s --check-prefixes=CHECK |
| ; RUN: opt < %s -passes='sroa<modify-cfg>' -S | FileCheck %s --check-prefixes=CHECK |
| ; This test checks that SROA runs mem2reg on structure that contains |
| ; homogeneous scalable vectors. |
| %struct.test = type { <vscale x 1 x i32>, <vscale x 1 x i32> } |
| define %struct.test @alloca(<vscale x 1 x i32> %x, <vscale x 1 x i32> %y) { |
| ; CHECK-NEXT: [[AGG0:%.*]] = insertvalue [[STRUCT_TEST:%.*]] undef, <vscale x 1 x i32> [[X:%.*]], 0 |
| ; CHECK-NEXT: [[AGG1:%.*]] = insertvalue [[STRUCT_TEST]] [[AGG0]], <vscale x 1 x i32> [[Y:%.*]], 1 |
| ; CHECK-NEXT: ret [[STRUCT_TEST]] [[AGG1]] |
| %addr = alloca %struct.test, align 4 |
| %agg0 = insertvalue %struct.test undef, <vscale x 1 x i32> %x, 0 |
| %agg1 = insertvalue %struct.test %agg0, <vscale x 1 x i32> %y, 1 |
| store %struct.test %agg1, %struct.test* %addr, align 4 |
| %val = load %struct.test, %struct.test* %addr, align 4 |