-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IndVars] Set Changed when we delete dead instructions. PR38855
IndVars does not set `Changed` flag when it eliminates dead instructions. As result, it may make IR modifications and report that it has done nothing. It leads to inconsistent preserved analyzes results. Differential Revision: https://reviews.llvm.org/D51770 Reviewed By: skatkov llvm-svn: 341633
- Loading branch information
Max Kazantsev
committed
Sep 7, 2018
1 parent
3ab0ee4
commit 9e6845d
Showing
2 changed files
with
25 additions
and
1 deletion.
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,24 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py | ||
; RUN: opt -S -inline -functionattrs -indvars < %s | FileCheck %s | ||
|
||
; Check that the invalidation happens correctly and the test does not crash. | ||
define void @f2() { | ||
; CHECK-LABEL: @f2( | ||
; CHECK-NEXT: entry: | ||
; CHECK-NEXT: br label [[FOR_COND:%.*]] | ||
; CHECK: for.cond: | ||
; CHECK-NEXT: br label [[FOR_COND]] | ||
; | ||
entry: | ||
br label %for.cond | ||
|
||
for.cond: ; preds = %for.cond, %entry | ||
%a.0 = phi i32 [ 1, %entry ], [ 0, %for.cond ] | ||
call void @f1(i32 %a.0) | ||
br label %for.cond | ||
} | ||
|
||
define internal void @f1(i32 %p1) noinline { | ||
entry: | ||
ret void | ||
} |