reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
;; Ensure the store verifier is not overzealous
; RUN: opt -newgvn -enable-phi-of-ops=true -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:    [[PHIOFOPS:%.*]] = phi i16 [ undef, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_INC]] ]
; CHECK-NEXT:    store i16 [[PHIOFOPS]], i16* @b, align 2
; CHECK-NEXT:    br label [[FOR_INC]]
; CHECK:       for.inc:
; CHECK-NEXT:    [[TMP0:%.*]] = load i16, i16* @b, align 2
; CHECK-NEXT:    [[INC]] = add i16 [[TMP0]], 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
}