brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · d7ce3c6 Raw
48 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt < %s --data-layout "e" -passes=dse -enable-dse-partial-store-merging=true -S | FileCheck %s3; RUN: opt < %s --data-layout "E" -passes=dse -enable-dse-partial-store-merging=true -S | FileCheck %s4 5; This test used to hit an assertion (see PR41949).6;7; Better safe than sorry, do not assume anything about the padding for the8; i28 store that has 32 bits as store size.9define void @test1(ptr %p) {10; CHECK-LABEL: @test1(11; CHECK-NEXT:    [[A:%.*]] = alloca i3212; CHECK-NEXT:    [[C1:%.*]] = getelementptr inbounds { i16, i16 }, ptr [[A]], i32 0, i32 113; CHECK-NEXT:    store i28 10, ptr [[A]]14; CHECK-NEXT:    store i16 20, ptr [[C1]]15; CHECK-NEXT:    call void @test1(ptr [[A]])16; CHECK-NEXT:    ret void17;18  %a = alloca i3219  %c1 = getelementptr inbounds { i16, i16 }, ptr %a, i32 0, i32 120  store i28 10, ptr %a21  store i16 20, ptr %c122 23  call void @test1(ptr %a)24  ret void25}26 27 28; This test used to mis-compile (see PR41949).29;30; Better safe than sorry, do not assume anything about the padding for the31; i12 store that has 16 bits as store size.32define void @test2(ptr %p) {33; CHECK-LABEL: @test2(34; CHECK-NEXT:    [[U:%.*]] = alloca i3235; CHECK-NEXT:    store i32 -1, ptr [[U]]36; CHECK-NEXT:    store i12 20, ptr [[U]]37; CHECK-NEXT:    call void @test2(ptr [[U]])38; CHECK-NEXT:    ret void39;40  %u = alloca i3241  store i32 -1, ptr %u42  store i12 20, ptr %u43 44  call void @test2(ptr %u)45  ret void46}47 48