brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · b8e33cd Raw
61 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt < %s -passes='sroa<preserve-cfg>' -S | FileCheck %s --check-prefixes=CHECK,CHECK-PRESERVE-CFG3; RUN: opt < %s -passes='sroa<modify-cfg>' -S | FileCheck %s --check-prefixes=CHECK,CHECK-MODIFY-CFG4 5target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-n8:16:32:64"6 7define { i32, i32 } @test0(i32 %x, i32 %y, { i32, i32 } %v) {8; CHECK-LABEL: @test0(9; CHECK-NEXT:  entry:10; CHECK-NEXT:    [[V_FCA_0_EXTRACT:%.*]] = extractvalue { i32, i32 } [[V:%.*]], 011; CHECK-NEXT:    [[V_FCA_1_EXTRACT:%.*]] = extractvalue { i32, i32 } [[V]], 112; CHECK-NEXT:    [[RESULT_FCA_0_INSERT:%.*]] = insertvalue { i32, i32 } poison, i32 [[X:%.*]], 013; CHECK-NEXT:    [[RESULT_FCA_1_INSERT:%.*]] = insertvalue { i32, i32 } [[RESULT_FCA_0_INSERT]], i32 [[Y:%.*]], 114; CHECK-NEXT:    ret { i32, i32 } [[RESULT_FCA_1_INSERT]]15;16entry:17  %a = alloca { i32, i32 }18 19  store { i32, i32 } %v, ptr %a20 21  %gep1 = getelementptr inbounds { i32, i32 }, ptr %a, i32 0, i32 022  store i32 %x, ptr %gep123  %gep2 = getelementptr inbounds { i32, i32 }, ptr %a, i32 0, i32 124  store i32 %y, ptr %gep225 26  %result = load { i32, i32 }, ptr %a27  ret { i32, i32 } %result28}29 30define { i32, i32 } @test1(i32 %x, i32 %y) {31; FIXME: This may be too conservative. Duncan argues that we are allowed to32; split the volatile load and store here but must produce volatile scalar loads33; and stores from them.34; CHECK-LABEL: @test1(35; CHECK-NEXT:  entry:36; CHECK-NEXT:    [[A:%.*]] = alloca { i32, i32 }, align 837; CHECK-NEXT:    [[B:%.*]] = alloca { i32, i32 }, align 838; CHECK-NEXT:    store i32 [[X:%.*]], ptr [[A]], align 839; CHECK-NEXT:    [[A_4_GEP2_SROA_IDX:%.*]] = getelementptr inbounds i8, ptr [[A]], i64 440; CHECK-NEXT:    store i32 [[Y:%.*]], ptr [[A_4_GEP2_SROA_IDX]], align 441; CHECK-NEXT:    [[A_0_RESULT:%.*]] = load volatile { i32, i32 }, ptr [[A]], align 842; CHECK-NEXT:    store volatile { i32, i32 } [[A_0_RESULT]], ptr [[B]], align 843; CHECK-NEXT:    ret { i32, i32 } [[A_0_RESULT]]44;45entry:46  %a = alloca { i32, i32 }47  %b = alloca { i32, i32 }48 49  %gep1 = getelementptr inbounds { i32, i32 }, ptr %a, i32 0, i32 050  store i32 %x, ptr %gep151  %gep2 = getelementptr inbounds { i32, i32 }, ptr %a, i32 0, i32 152  store i32 %y, ptr %gep253 54  %result = load volatile { i32, i32 }, ptr %a55  store volatile { i32, i32 } %result, ptr %b56  ret { i32, i32 } %result57}58;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:59; CHECK-MODIFY-CFG: {{.*}}60; CHECK-PRESERVE-CFG: {{.*}}61