brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.3 KiB · 4121ccb Raw
85 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-CFG4target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32:64-S128"5target triple = "sparcv9-sun-solaris"6 7; PR372678; Check that we don't crash on this test.9 10define i16 @f1() {11; CHECK-LABEL: @f1(12; CHECK-NEXT:  bb1:13; CHECK-NEXT:    [[RC:%.*]] = add i16 2, 214; CHECK-NEXT:    ret i16 [[RC]]15;16bb1:17; This 12-byte alloca is split into partitions as [0,2), [2,4), [4,8), [8,10), [10, 12).18; The reported error happened when rewriteIntegerStore try to widen a split tail of slice 1 for [4, 8) partition.19; alloca  01234567890120; slice 1:  WWWW21; slice 2:        WWWW22; slice 3:        RR23; slice 4:  RR24 25  %a.3 = alloca [6 x i16], align 126; slice 1: [2,6)27  %_tmp3 = getelementptr inbounds [6 x i16], ptr %a.3, i16 0, i16 128  store i32 131074, ptr %_tmp3, align 129; slice 2: [8,12)30  %_tmp8 = getelementptr inbounds [6 x i16], ptr %a.3, i16 0, i16 431  store i32 131074, ptr %_tmp8, align 132; slice 3: [8,10)33  %_tmp12 = getelementptr inbounds [6 x i16], ptr %a.3, i16 0, i16 434  %_tmp13 = load i16, ptr %_tmp12, align 135; slice 4: [2,4)36  %_tmp15 = getelementptr inbounds [6 x i16], ptr %a.3, i16 0, i16 137  %_tmp16 = load i16, ptr %_tmp15, align 138 39  %rc = add i16 %_tmp13, %_tmp1640  ret i16 %rc41}42 43define i16 @f2() {44; CHECK-LABEL: @f2(45; CHECK-NEXT:  bb1:46; CHECK-NEXT:    [[A_3_SROA_2_2_INSERT_EXT:%.*]] = zext i16 undef to i3247; CHECK-NEXT:    [[A_3_SROA_2_2_INSERT_MASK:%.*]] = and i32 undef, -6553648; CHECK-NEXT:    [[A_3_SROA_2_2_INSERT_INSERT:%.*]] = or i32 [[A_3_SROA_2_2_INSERT_MASK]], [[A_3_SROA_2_2_INSERT_EXT]]49; CHECK-NEXT:    [[A_3_SROA_0_2_INSERT_EXT:%.*]] = zext i16 undef to i3250; CHECK-NEXT:    [[A_3_SROA_0_2_INSERT_SHIFT:%.*]] = shl i32 [[A_3_SROA_0_2_INSERT_EXT]], 1651; CHECK-NEXT:    [[A_3_SROA_0_2_INSERT_MASK:%.*]] = and i32 [[A_3_SROA_2_2_INSERT_INSERT]], 6553552; CHECK-NEXT:    [[A_3_SROA_0_2_INSERT_INSERT:%.*]] = or i32 [[A_3_SROA_0_2_INSERT_MASK]], [[A_3_SROA_0_2_INSERT_SHIFT]]53; CHECK-NEXT:    [[RC:%.*]] = add i16 2, undef54; CHECK-NEXT:    ret i16 [[RC]]55;56bb1:57; This 12-byte alloca is split into partitions as [0,2), [2,4), [4,8), [8,10), [10, 12).58; The reported error happened when visitLoadInst rewrites a split tail of slice 1 for [4, 8) partition.59; alloca  01234567890160; slice 1:  RRRR61; slice 2:        WWWW62; slice 3:        RR63; slice 4:  RR64 65  %a.3 = alloca [6 x i16], align 166; slice 1: [2,6)67  %_tmp3 = getelementptr inbounds [6 x i16], ptr %a.3, i16 0, i16 168  %_tmp6 = load i32, ptr %_tmp3, align 169; slice 2: [8,12)70  %_tmp8 = getelementptr inbounds [6 x i16], ptr %a.3, i16 0, i16 471  store i32 131074, ptr %_tmp8, align 172; slice 3: [8,10)73  %_tmp12 = getelementptr inbounds [6 x i16], ptr %a.3, i16 0, i16 474  %_tmp13 = load i16, ptr %_tmp12, align 175; slice 4: [2,4)76  %_tmp15 = getelementptr inbounds [6 x i16], ptr %a.3, i16 0, i16 177  %_tmp16 = load i16, ptr %_tmp15, align 178 79  %rc = add i16 %_tmp13, %_tmp1680  ret i16 %rc81}82;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:83; CHECK-MODIFY-CFG: {{.*}}84; CHECK-PRESERVE-CFG: {{.*}}85