1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 2 3; REQUIRES: asserts 4 5; Eliminates store to %R in the entry block. 6; RUN: opt < %s -basic-aa -dse -debug-counter=dse-memoryssa-skip=0,dse-memoryssa-count=1 -S | FileCheck --check-prefix=SKIP0-COUNT1 %s 7 8; Eliminates store to %P in the entry block. 9; RUN: opt < %s -basic-aa -dse -debug-counter=dse-memoryssa-skip=1,dse-memoryssa-count=1 -S | FileCheck --check-prefix=SKIP1-COUNT1 %s 10 11; Eliminates both stores in the entry block. 12; RUN: opt < %s -basic-aa -dse -debug-counter=dse-memoryssa-skip=0,dse-memoryssa-count=2 -S | FileCheck --check-prefix=SKIP0-COUNT2 %s 13 14; Eliminates no stores. 15; RUN: opt < %s -basic-aa -dse -debug-counter=dse-memoryssa-skip=2,dse-memoryssa-count=1 -S | FileCheck --check-prefix=SKIP2-COUNT1 %s 16 17 18target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" 19 20 21define void @test(i32* noalias %P, i32* noalias %Q, i32* noalias %R) { 22; SKIP0-COUNT1-LABEL: @test( 23; SKIP0-COUNT1-NEXT: store i32 1, i32* [[P:%.*]] 24; SKIP0-COUNT1-NEXT: br i1 true, label [[BB1:%.*]], label [[BB2:%.*]] 25; SKIP0-COUNT1: bb1: 26; SKIP0-COUNT1-NEXT: br label [[BB3:%.*]] 27; SKIP0-COUNT1: bb2: 28; SKIP0-COUNT1-NEXT: br label [[BB3]] 29; SKIP0-COUNT1: bb3: 30; SKIP0-COUNT1-NEXT: store i32 0, i32* [[Q:%.*]] 31; SKIP0-COUNT1-NEXT: store i32 0, i32* [[R:%.*]] 32; SKIP0-COUNT1-NEXT: store i32 0, i32* [[P]] 33; SKIP0-COUNT1-NEXT: ret void 34; 35; SKIP1-COUNT1-LABEL: @test( 36; SKIP1-COUNT1-NEXT: store i32 1, i32* [[R:%.*]] 37; SKIP1-COUNT1-NEXT: br i1 true, label [[BB1:%.*]], label [[BB2:%.*]] 38; SKIP1-COUNT1: bb1: 39; SKIP1-COUNT1-NEXT: br label [[BB3:%.*]] 40; SKIP1-COUNT1: bb2: 41; SKIP1-COUNT1-NEXT: br label [[BB3]] 42; SKIP1-COUNT1: bb3: 43; SKIP1-COUNT1-NEXT: store i32 0, i32* [[Q:%.*]] 44; SKIP1-COUNT1-NEXT: store i32 0, i32* [[R]] 45; SKIP1-COUNT1-NEXT: store i32 0, i32* [[P:%.*]] 46; SKIP1-COUNT1-NEXT: ret void 47; 48; SKIP0-COUNT2-LABEL: @test( 49; SKIP0-COUNT2-NEXT: br i1 true, label [[BB1:%.*]], label [[BB2:%.*]] 50; SKIP0-COUNT2: bb1: 51; SKIP0-COUNT2-NEXT: br label [[BB3:%.*]] 52; SKIP0-COUNT2: bb2: 53; SKIP0-COUNT2-NEXT: br label [[BB3]] 54; SKIP0-COUNT2: bb3: 55; SKIP0-COUNT2-NEXT: store i32 0, i32* [[Q:%.*]] 56; SKIP0-COUNT2-NEXT: store i32 0, i32* [[R:%.*]] 57; SKIP0-COUNT2-NEXT: store i32 0, i32* [[P:%.*]] 58; SKIP0-COUNT2-NEXT: ret void 59; 60; SKIP2-COUNT1-LABEL: @test( 61; SKIP2-COUNT1-NEXT: store i32 1, i32* [[P:%.*]] 62; SKIP2-COUNT1-NEXT: store i32 1, i32* [[R:%.*]] 63; SKIP2-COUNT1-NEXT: br i1 true, label [[BB1:%.*]], label [[BB2:%.*]] 64; SKIP2-COUNT1: bb1: 65; SKIP2-COUNT1-NEXT: br label [[BB3:%.*]] 66; SKIP2-COUNT1: bb2: 67; SKIP2-COUNT1-NEXT: br label [[BB3]] 68; SKIP2-COUNT1: bb3: 69; SKIP2-COUNT1-NEXT: store i32 0, i32* [[Q:%.*]] 70; SKIP2-COUNT1-NEXT: store i32 0, i32* [[R]] 71; SKIP2-COUNT1-NEXT: store i32 0, i32* [[P]] 72; SKIP2-COUNT1-NEXT: ret void 73; 74 store i32 1, i32* %P 75 store i32 1, i32* %R 76 br i1 true, label %bb1, label %bb2 77bb1: 78 br label %bb3 79bb2: 80 br label %bb3 81bb3: 82 store i32 0, i32* %Q 83 store i32 0, i32* %R 84 store i32 0, i32* %P 85 ret void 86} 87