brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 4eb090e Raw
56 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 52; RUN: opt < %s -passes=gvn -S | FileCheck %s --check-prefixes=CHECK,MDEP3; RUN: opt < %s -passes='gvn<memoryssa>' -S | FileCheck %s --check-prefixes=CHECK,MSSA4 5define i32 @main(ptr %p, i32 %x, i32 %y) {6; MDEP-LABEL: define i32 @main(7; MDEP-SAME: ptr [[P:%.*]], i32 [[X:%.*]], i32 [[Y:%.*]]) {8; MDEP-NEXT:  [[BLOCK1:.*:]]9; MDEP-NEXT:    [[CMP:%.*]] = icmp eq i32 [[X]], [[Y]]10; MDEP-NEXT:    br i1 [[CMP]], label %[[BLOCK2:.*]], label %[[BLOCK3:.*]]11; MDEP:       [[BLOCK2]]:12; MDEP-NEXT:    [[DEAD_PRE:%.*]] = load i32, ptr [[P]], align 413; MDEP-NEXT:    br label %[[BLOCK4:.*]]14; MDEP:       [[BLOCK3]]:15; MDEP-NEXT:    store i32 0, ptr [[P]], align 416; MDEP-NEXT:    br label %[[BLOCK4]]17; MDEP:       [[BLOCK4]]:18; MDEP-NEXT:    [[DEAD:%.*]] = phi i32 [ 0, %[[BLOCK3]] ], [ [[DEAD_PRE]], %[[BLOCK2]] ]19; MDEP-NEXT:    ret i32 [[DEAD]]20;21; MSSA-LABEL: define i32 @main(22; MSSA-SAME: ptr [[P:%.*]], i32 [[X:%.*]], i32 [[Y:%.*]]) {23; MSSA-NEXT:  [[BLOCK1:.*:]]24; MSSA-NEXT:    [[Z:%.*]] = load i32, ptr [[P]], align 425; MSSA-NEXT:    [[CMP:%.*]] = icmp eq i32 [[X]], [[Y]]26; MSSA-NEXT:    br i1 [[CMP]], label %[[BLOCK2:.*]], label %[[BLOCK3:.*]]27; MSSA:       [[BLOCK2]]:28; MSSA-NEXT:    br label %[[BLOCK4:.*]]29; MSSA:       [[BLOCK3]]:30; MSSA-NEXT:    store i32 0, ptr [[P]], align 431; MSSA-NEXT:    br label %[[BLOCK4]]32; MSSA:       [[BLOCK4]]:33; MSSA-NEXT:    [[DEAD:%.*]] = load i32, ptr [[P]], align 434; MSSA-NEXT:    ret i32 [[DEAD]]35;36block1:37  %z = load i32, ptr %p38  %cmp = icmp eq i32 %x, %y39  br i1 %cmp, label %block2, label %block340 41block2:42  br label %block443 44block3:45  %b = bitcast i32 0 to i3246  store i32 %b, ptr %p47  br label %block448 49block4:50  %DEAD = load i32, ptr %p51  ret i32 %DEAD52}53 54;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:55; CHECK: {{.*}}56