llvm-project/llvm/test/Transforms/NewGVN/pr33461.ll

37 lines
1.2 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
;; Ensure the store verifier is not overzealous
; RUN: opt -newgvn -S %s | FileCheck %s
@b = external global i16, align 2
define void @patatino() {
; CHECK-LABEL: @patatino(
; CHECK-NEXT: entry:
; CHECK-NEXT: br i1 false, label [[FOR_COND1:%.*]], label [[FOR_INC:%.*]]
; CHECK: for.cond1:
; CHECK-NEXT: [[TMP0:%.*]] = phi i16 [ [[INC:%.*]], [[FOR_INC]] ], [ undef, [[ENTRY:%.*]] ]
; CHECK-NEXT: store i16 [[TMP0]], i16* @b, align 2
; CHECK-NEXT: br label [[FOR_INC]]
; CHECK: for.inc:
; CHECK-NEXT: [[TMP1:%.*]] = load i16, i16* @b, align 2
; CHECK-NEXT: [[INC]] = add i16 [[TMP1]], 1
; CHECK-NEXT: store i16 [[INC]], i16* @b, align 2
; CHECK-NEXT: br label [[FOR_COND1]]
;
entry:
br i1 false, label %for.cond1, label %for.inc
for.cond1:
%e.0 = phi i16* [ %e.1, %for.inc ], [ null, %entry ]
%0 = load i16, i16* %e.0, align 2
%add = add i16 %0, 0
store i16 %add, i16* %e.0, align 2
br label %for.inc
for.inc:
%e.1 = phi i16* [ %e.0, %for.cond1 ], [ @b, %entry ]
%1 = load i16, i16* @b, align 2
%inc = add i16 %1, 1
store i16 %inc, i16* @b, align 2
br label %for.cond1
}