| ; 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 |
| } |