forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NewGVN: Fix PR 33461, caused by slightly overzealous verification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305657 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
2 changed files
with
66 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
; 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 | ||
} |