brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · 49e4843 Raw
65 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 42; PR32952: Don't erroneously consider congruent two phi nodes which3; have the same arguments but different incoming edges.4; RUN: opt -passes=newgvn -S %s | FileCheck %s5 6@a = common global i16 0, align 27@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 18 9define i32 @tinkywinky() {10; CHECK-LABEL: define i32 @tinkywinky() {11; CHECK-NEXT:  entry:12; CHECK-NEXT:    [[TMP0:%.*]] = load i16, ptr @a, align 213; CHECK-NEXT:    [[CONV:%.*]] = sext i16 [[TMP0]] to i3214; CHECK-NEXT:    [[NEG:%.*]] = xor i32 [[CONV]], -115; CHECK-NEXT:    [[CONV1:%.*]] = trunc i32 [[NEG]] to i1616; CHECK-NEXT:    [[CONV3:%.*]] = zext i16 [[CONV1]] to i3217; CHECK-NEXT:    [[CMP:%.*]] = icmp slt i32 [[CONV]], [[CONV3]]18; CHECK-NEXT:    br i1 [[CMP]], label [[TINKY:%.*]], label [[WINKY:%.*]]19; CHECK:       tinky:20; CHECK-NEXT:    store i16 2, ptr @a, align 221; CHECK-NEXT:    br label [[PATATINO:%.*]]22; CHECK:       winky:23; CHECK-NEXT:    br label [[PATATINO]]24; CHECK:       patatino:25; CHECK-NEXT:    [[MEH:%.*]] = phi i16 [ [[TMP0]], [[WINKY]] ], [ [[CONV1]], [[TINKY]] ]26; CHECK-NEXT:    [[BANANA:%.*]] = phi i16 [ [[TMP0]], [[TINKY]] ], [ [[CONV1]], [[WINKY]] ]27; CHECK-NEXT:    br label [[END:%.*]]28; CHECK:       end:29; CHECK-NEXT:    [[PROMOTED:%.*]] = zext i16 [[BANANA]] to i3230; CHECK-NEXT:    [[OTHER:%.*]] = zext i16 [[MEH]] to i3231; CHECK-NEXT:    [[FIRST:%.*]] = tail call i32 (ptr, ...) @printf(ptr @.str, i32 [[PROMOTED]])32; CHECK-NEXT:    [[SECOND:%.*]] = tail call i32 (ptr, ...) @printf(ptr @.str, i32 [[OTHER]])33; CHECK-NEXT:    ret i32 034;35entry:36  %0 = load i16, ptr @a, align 237  %conv = sext i16 %0 to i3238  %neg = xor i32 %conv, -139  %conv1 = trunc i32 %neg to i1640  %conv3 = zext i16 %conv1 to i3241  %cmp = icmp slt i32 %conv, %conv342  br i1 %cmp, label %tinky, label %winky43 44tinky:45  store i16 2, ptr @a, align 246  br label %patatino47 48winky:49  br label %patatino50 51patatino:52  %meh = phi i16 [ %0, %winky ], [ %conv1, %tinky ]53  %banana = phi i16 [ %0, %tinky ], [ %conv1, %winky ]54  br label %end55 56end:57  %promoted = zext i16 %banana to i3258  %other = zext i16 %meh to i3259  %first = tail call i32 (ptr, ...) @printf(ptr @.str, i32 %promoted)60  %second = tail call i32 (ptr, ...) @printf(ptr @.str, i32 %other)61  ret i32 062}63 64declare i32 @printf(ptr, ...)65