brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1008 B · a9ca0f9 Raw
35 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -S -passes=dse < %s | FileCheck %s3 4; Assume that %p1 != %p2 if and only if %c is true. In that case the noalias5; metadata is correct, but the first store cannot be eliminated, as it may be6; read-clobbered by the load.7define void @test(i1 %c, ptr %p1, ptr %p2) {8; CHECK-LABEL: @test(9; CHECK-NEXT:    store i8 0, ptr [[P1:%.*]], align 110; CHECK-NEXT:    [[TMP1:%.*]] = load i8, ptr [[P2:%.*]], align 1, !alias.scope !011; CHECK-NEXT:    br i1 [[C:%.*]], label [[IF:%.*]], label [[ELSE:%.*]]12; CHECK:       if:13; CHECK-NEXT:    store i8 1, ptr [[P1]], align 1, !noalias !014; CHECK-NEXT:    ret void15; CHECK:       else:16; CHECK-NEXT:    store i8 2, ptr [[P1]], align 117; CHECK-NEXT:    ret void18;19  store i8 0, ptr %p120  load i8, ptr %p2, !alias.scope !221  br i1 %c, label %if, label %else22 23if:24  store i8 1, ptr %p1, !noalias !225  ret void26 27else:28  store i8 2, ptr %p129  ret void30}31 32!0 = !{!0}33!1 = !{!1, !0}34!2 = !{!1}35